
===== 1_Main Sample.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



2    

3    libname reprisk "F:\bdata\RepRisk";

NOTE: Libref REPRISK was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: F:\bdata\RepRisk

3  !                                     run;

4    libname data "H:\project\ESG News and Customer\Data";

NOTE: Libref DATA was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: H:\project\ESG News and Customer\Data

4  !                                                       run;

5    

6    /*******************1. Import and clean reprisk data********************/

7    data newsdata2;

8    set reprisk.repriskus2017_2020;

9    if index(related_countries,'United States of America') ge 1 then USnews=1;

10   if index(source_language,'English') ge 1 then news_english=1;

11   cusip6=substr(ISIN,3,6);

12   run;



NOTE: There were 6738982 observations read from the data set REPRISK.REPRISKUS2017_2020.

NOTE: The data set WORK.NEWSDATA2 has 6738982 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           7:35.98

      cpu time            1:09.01

      



13   

14   /*dropping duplications*/

15   proc sort nodupkey data=newsdata2 out=newsdata4;

16   by cusip6 news_date reprisk_story_id reprisk_substory_id;

17   run;



NOTE: There were 6738982 observations read from the data set WORK.NEWSDATA2.

NOTE: 6492899 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 18 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           22.84 seconds

      cpu time            18.64 seconds

      



18   

19   /*************construct E S G issues*****************/

20   data newsdata4;

21   set newsdata4;

22   

23   if kindex(related_issues,"Climate change")>0 then d_issue1=1;

24   if kindex(related_issues,"Other environmental issues")>0 then d_issue1=1;

25   if kindex(related_issues,"Waste issues")>0 then d_issue1=1;

26   if kindex(related_issues,"Overuse and wasting of resources")>0 then d_issue1=1;

27   if kindex(related_issues,"Impacts on landscapes, ecosystems and biodiversity")>0 then d_issue1=1;

28   if kindex(related_issues,"Local pollution")>0 then d_issue1=1;

29   if kindex(related_issues,"Animal mistreatment")>0 then d_issue1=1;

30   if d_issue1=. then d_issue1=0;

31   

32   if kindex(related_issues,"Child labor")>0 then d_issue2=1;

33   if kindex(related_issues,"Discrimination in employment")>0 then d_issue2=1;

34   if kindex(related_issues,"Forced labor")>0 then d_issue2=1;

35   if kindex(related_issues,"Human rights abuses and corporate complicity")>0 then d_issue2=1;

36   if kindex(related_issues,"Freedom of association and collective bargaining")>0 then d_issue2=1;

37   if kindex(related_issues,"Impacts on communities")>0 then d_issue2=1;

38   if kindex(related_issues,"Local participation issues")>0 then d_issue2=1;

39   if kindex(related_issues,"Occupational health and safety issues")>0 then d_issue2=1;

40   if kindex(related_issues,"Other social issues")>0 then d_issue2=1;

41   if kindex(related_issues,"Poor employment conditions")>0 then d_issue2=1;

42   if kindex(related_issues,"Social discrimination")>0 then d_issue2=1;

43   if d_issue2=. then d_issue2=0;

44   

45   if kindex(related_issues,"Anti-competitive practices")>0 then d_issue3=1;

46   if kindex(related_issues,"Corruption, bribery, extortion and money laundering")>0 then d_issue3=1

46 ! ;

47   if kindex(related_issues,"Executive compensation issues")>0 then d_issue3=1;

48   if kindex(related_issues,"Fraud")>0 then d_issue3=1;

49   if kindex(related_issues,"Misleading communication")>0 then d_issue3=1;

50   if kindex(related_issues,"Tax evasion")>0 then d_issue3=1;

51   if kindex(related_issues,"Tax optimization")>0 then d_issue3=1;

52   if kindex(related_issues,"Other issues")>0 then d_issue3=1;

53   if d_issue3=. then d_issue3=0;

54   

55   if kindex(related_issues,"Products (health and environmental issues")>0 then crosscutting=1;

56   if kindex(related_issues,"Controversial products and services")>0 then crosscutting=1;

57   if kindex(related_issues,"Supply chain issues")>0 then crosscutting=1;

58   if kindex(related_issues,"Violation of international standards")>0 then crosscutting=1;

59   if kindex(related_issues,"Violation of national legislation")>0 then crosscutting=1;

60   if crosscutting=. then crosscutting=0;

61   

62   if kindex(related_issues,"Child labor")>0 then employee=1;

63   if kindex(related_issues,"Discrimination in employment")>0 then employee=1;

64   if kindex(related_issues,"Forced labor")>0 then employee=1;

65   if kindex(related_issues,"Freedom of association and collective bargaining")>0 then employee=1;

66   if kindex(related_issues,"Occupational health and safety issues")>0 then employee=1;

67   if kindex(related_issues,"Poor employment conditions")>0 then employee=1;

68   

69   if kindex(related_issues,"Social discrimination")>0 then community=1;

70   if kindex(related_issues,"Human rights abuses and corporate complicity")>0 then community=1;

71   if kindex(related_issues,"Impacts on communities")>0 then community=1;

72   if kindex(related_issues,"Local participation issues")>0 then community=1;

73   if kindex(related_issues,"Other social issues")>0 then community=1;

74   

75   if community=. then community=0;

76   if employee=. then employee=0;

77   

78   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 24 variables.

NOTE: DATA statement used (Total process time):

      real time           6.75 seconds

      cpu time            6.48 seconds

      



79   

80   

81   /*****Get highest news category, novelty, reach, severity per news date****/

82   proc sort data = newsdata4;

83   by cusip6 news_date;

84   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 24 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           3.49 seconds

      cpu time            4.62 seconds

      



85   

86   proc means data = newsdata4 noprint;

87   by cusip6 news_date;

88   var d_issue1 d_issue2 d_issue3 crosscutting severity novelty reach employee community;

89   output out=newsdata4_2(drop=_type_ _freq_)

90   max=md_issue1 md_issue2 md_issue3 mcrosscutting mseverity mnovelty mreach memployee mcommunity;

91   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4_2 has 177511 observations and 11 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           1.49 seconds

      cpu time            1.43 seconds

      



92   

93   /*****Number of news each day*****/

94   proc sort data = newsdata4 nodupkey out = newsdata4_3;

95   by cusip6 news_date reprisk_story_id;

96   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: 46156 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA4_3 has 199927 observations and 24 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           2.84 seconds

      cpu time            3.71 seconds

      



97   

98   data newsdata4_3;

99   set newsdata4_3;

100  news = 1;

101  run;



NOTE: There were 199927 observations read from the data set WORK.NEWSDATA4_3.

NOTE: The data set WORK.NEWSDATA4_3 has 199927 observations and 25 variables.

NOTE: DATA statement used (Total process time):

      real time           1.41 seconds

      cpu time            1.39 seconds

      



102  

103  proc means data = newsdata4_3 noprint;

104  by cusip6 news_date;

105  var news;

106  output out = ndailynews(drop=_type_ _freq_) sum = ndailynews;

107  run;



NOTE: There were 199927 observations read from the data set WORK.NEWSDATA4_3.

NOTE: The data set WORK.NDAILYNEWS has 177511 observations and 3 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           1.19 seconds

      cpu time            1.18 seconds

      



108  

109  

110  /****Merge news chacracteristics and # of news together******/

111  data newsdata5;

112  merge newsdata4_2 ndailynews;

113  by cusip6 news_date;

114  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA4_2.

NOTE: There were 177511 observations read from the data set WORK.NDAILYNEWS.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 12 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.03 seconds

      



115  

116  /*Finding the distance between previous news and current news*/

117  proc sort data=newsdata5; by cusip6 news_date ; run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 12 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.05 seconds

      cpu time            0.07 seconds

      



118  

119  data newsdata5;

120  set newsdata5;

121  lagcusip6=lag(cusip6);

122  lagnews_date=lag(news_date);

123  if cusip6 ne lagcusip6 then lagnews_date=.;

124  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 14 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



125  

126  data newsdata5;

127  set newsdata5;

128  date_distance=news_date-lagnews_date;

129  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      6990 at 128:24   

NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 15 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



130  

131  /*Finding the distance between future news and current news*/

132  proc sort data=newsdata5; by cusip6 descending news_date; run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 15 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.05 seconds

      cpu time            0.07 seconds

      



133  

134  data newsdata5;

135  set newsdata5;

136  forcusip6=lag(cusip6);

137  fornews_date=lag(news_date);

138  if cusip6 ne forcusip6 then fornews_date=.;

139  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 17 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.03 seconds

      



140  

141  data newsdata5;

142  set newsdata5;

143  nextdate_distance=fornews_date-news_date;

144  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      6990 at 143:31   

NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



145  

146  

147  /*further clean the data*/

148  data newsdata5;

149  set newsdata5;

150  if cusip6=' ' then delete;

151  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



152  

153  data newsdata5;

154  set newsdata5;

155  date_distance2=date_distance;

156  if date_distance=. then date_distance2=100;

157  nextdate_distance2=nextdate_distance;

158  if nextdate_distance=. then nextdate_distance2=100;

159  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 20 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



160  

161  /*only keep news between 2018 to 2020*/

162  data newsdata5;

163  set newsdata5;

164  if year(news_date)<2018 then delete;

165  if year(news_date)>2020 then delete;

166  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 129601 observations and 20 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



167  

168  proc sort data = newsdata5 nodupkey out = test; by cusip6; run;



NOTE: There were 129601 observations read from the data set WORK.NEWSDATA5.

NOTE: 123129 observations with duplicate key values were deleted.

NOTE: The data set WORK.TEST has 6472 observations and 20 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



169  proc means data = newsdata5 sum; var md_issue1--md_issue3; run;



NOTE: Writing HTML Body file: sashtml.htm

NOTE: There were 129601 observations read from the data set WORK.NEWSDATA5.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.14 seconds

      cpu time            0.12 seconds

      



170  

171  

172  

173  /*************2. Import Compustat data to merge with RepRisk***********/

174  data qcompustat;

175  set data.compustat_quarter;

176  if atq>0;

177  if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

178  MVEQ=(PRCCQ*CSHOQ);

179  MTBQ=MVEQ/CEQQ;

180  BTMQ=CEQQ/MVEQ;

181  lnMVEQ=log(MVEQ);

182  lnATQ=log(ATQ);

183  *LEVQ=(DLTTQ+DLCQ)/ATQ;

184  *LEV_MVEQ=(DLTTQ+DLCQ)/MVEQ;

185  Leverageq=LTQ/ATQ;

186  IBQ_ATQ=IBQ/ATQ;

187  if IBQ<0 and IBQ ne . then Loss=1;

188  if IBQ>=0 and IBQ ne . then Loss=0;

189  lnsaleq=log(1+saleq);

190  run;



NOTE: Invalid argument to function LOG(-0.198) at line 189 column 9.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ACMTA

cusip=004616207 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=30APR2020 atq=55.544 ceqq=28.126

cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639 lctq=. ltq=27.418 saleq=-1.198 seqq=28.126 teqq=28.126

txdbq=0 capxy=0.015 exchg=19 costat=A prccq=32.3 sic=6351 MVEQ=25.6462 MTBQ=0.9118324682

BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995 Leverageq=0.4936266743 IBQ_ATQ=-0.029508138

Loss=1 lnsaleq=. _ERROR_=1 _N_=243

NOTE: Invalid argument to function LOG(-0.091) at line 189 column 9.

gvkey=001790 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=AB.

cusip=043420108 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=26JUN2020 atq=29.565 ceqq=-20.591

cheq=2.976 chq=0.187 cshoq=2.837 ibq=-0.318 lctq=4.728 ltq=50.156 saleq=-1.091 seqq=-20.591

teqq=-20.591 txdbq=0.324 capxy=0.002 exchg=9 costat=A prccq=0.35 sic=6799 MVEQ=0.99295

MTBQ=-0.048222524 BTMQ=-20.73719724 lnMVEQ=-0.007074969 lnATQ=3.3865912293 Leverageq=1.6964654152

IBQ_ATQ=-0.010755961 Loss=1 lnsaleq=. _ERROR_=1 _N_=1691

NOTE: Invalid argument to function LOG(-9009) at line 189 column 9.

gvkey=002176 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=BRK.B

cusip=084670702 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=02MAY2020 atq=760448 ceqq=371565

cheq=144480 chq=42640 cshoq=2430.035 ibq=-49746 lctq=. ltq=385213 saleq=-9010 seqq=371565 teqq=375235

txdbq=. capxy=2968 exchg=11 costat=A prccq=182.83 sic=9997 MVEQ=444283.29905 MTBQ=1.1957081508

BTMQ=0.8363244821 lnMVEQ=13.004217699 lnATQ=13.541663012 Leverageq=0.5065606064 IBQ_ATQ=-0.065416702

Loss=1 lnsaleq=. _ERROR_=1 _N_=2441

NOTE: Invalid argument to function LOG(-4.5) at line 189 column 9.

gvkey=011729 datadate=31DEC2016 fyearq=2016 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2016Q4 datafqtr=2016Q4 rdq=07FEB2017 atq=6544.7 ceqq=3603.3

cheq=650.1 chq=149.8 cshoq=4.564 ibq=-46.9 lctq=. ltq=2807.5 saleq=-5.5 seqq=3603.3 teqq=3737.2

txdbq=0 capxy=4.3 exchg=11 costat=A prccq=836.05 sic=6351 MVEQ=3815.7322 MTBQ=1.0589549025

BTMQ=0.9443272775 lnMVEQ=8.2468878519 lnATQ=8.7864108408 Leverageq=0.4289730622 IBQ_ATQ=-0.007166104

Loss=1 lnsaleq=. _ERROR_=1 _N_=21894

NOTE: Invalid argument to function LOG(-69.6) at line 189 column 9.

gvkey=011729 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=3739.7 ceqq=3076.7

cheq=274 chq=136.4 cshoq=3.135 ibq=-129.7 lctq=. ltq=780.6 saleq=-70.6 seqq=3076.7 teqq=2959.1 txdbq=.

capxy=0 exchg=11 costat=A prccq=910 sic=6351 MVEQ=2852.85 MTBQ=0.9272434752 BTMQ=1.0784653943

lnMVEQ=7.9560737736 lnATQ=8.2267606733 Leverageq=0.2087333209 IBQ_ATQ=-0.034681926 Loss=1 lnsaleq=.

_ERROR_=1 _N_=21907

NOTE: Invalid argument to function LOG(-1.058) at line 189 column 9.

gvkey=011957 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=TOF.U

cusip=87725P105 curcdq=CAD datacqtr=2018Q2 datafqtr=2018Q2 rdq=20AUG2018 atq=14.763 ceqq=13.986

cheq=14.721 chq=0.261 cshoq=1.411 ibq=-2.336 lctq=0.777 ltq=0.777 saleq=-2.058 seqq=13.986 teqq=13.986

txdbq=0 capxy=0 exchg=7 costat=I prccq=10.97 sic=6199 MVEQ=15.47867 MTBQ=1.1067260117

BTMQ=0.9035660041 lnMVEQ=2.7394629472 lnATQ=2.6921240506 Leverageq=0.0526315789 IBQ_ATQ=-0.158233421

Loss=1 lnsaleq=. _ERROR_=1 _N_=22530

NOTE: Invalid argument to function LOG(-28) at line 189 column 9.

gvkey=013561 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MBI

cusip=55262C100 curcdq=USD datacqtr=2018Q2 datafqtr=2018Q2 rdq=08AUG2018 atq=8699 ceqq=1103 cheq=675

chq=197 cshoq=90.662 ibq=-146 lctq=. ltq=7584 saleq=-29 seqq=1103 teqq=1115 txdbq=0 capxy=0 exchg=11

costat=A prccq=9.04 sic=6351 MVEQ=819.58448 MTBQ=0.7430502992 BTMQ=1.3458039127 lnMVEQ=6.7087974801

lnATQ=9.0709633555 Leverageq=0.8718243476 IBQ_ATQ=-0.016783538 Loss=1 lnsaleq=. _ERROR_=1 _N_=26114

NOTE: Invalid argument to function LOG(-42) at line 189 column 9.

gvkey=013709 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=IEP

cusip=451100101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=24306 ceqq=3635 cheq=3257

chq=2381 cshoq=214.186 ibq=-1384 lctq=. ltq=14889 saleq=-43 seqq=3635 teqq=9417 txdbq=533 capxy=53

exchg=14 costat=A prccq=48.42 sic=9997 MVEQ=10370.88612 MTBQ=2.8530635818 BTMQ=0.3505004257

lnMVEQ=9.2467577479 lnATQ=10.098478512 Leverageq=0.6125647988 IBQ_ATQ=-0.056940673 Loss=1 lnsaleq=.

_ERROR_=1 _N_=26550

NOTE: Invalid argument to function LOG(-989) at line 189 column 9.

gvkey=014326 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ONEXF

cusip=68272K103 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=15MAY2020 atq=6184 ceqq=5904 cheq=813

chq=379 cshoq=99.159 ibq=-997 lctq=. ltq=280 saleq=-990 seqq=5904 teqq=5904 txdbq=. capxy=0 exchg=19

costat=A prccq=. sic=6799 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=. lnATQ=8.7297205903 Leverageq=0.0452781371

IBQ_ATQ=-0.16122251 Loss=1 lnsaleq=. _ERROR_=1 _N_=28182

NOTE: Invalid argument to function LOG(-98) at line 189 column 9.

gvkey=014824 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=CINF

cusip=172062101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=27APR2020 atq=23367 ceqq=8042 cheq=988

chq=486 cshoq=160.8 ibq=-1226 lctq=. ltq=15325 saleq=-99 seqq=8042 teqq=8042 txdbq=660 capxy=4

exchg=14 costat=A prccq=75.45 sic=6331 MVEQ=12132.36 MTBQ=1.5086247202 BTMQ=0.6628553719

lnMVEQ=9.403631542 lnATQ=10.05908005 Leverageq=0.6558394317 IBQ_ATQ=-0.052467155 Loss=1 lnsaleq=.

_ERROR_=1 _N_=30164

NOTE: Invalid argument to function LOG(-69.092) at line 189 column 9.

gvkey=015082 datadate=31MAR2016 fyearq=2016 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2016Q1 datafqtr=2016Q1 rdq=13MAY2016 atq=1870.033 ceqq=676.583

cheq=8.444 chq=7.986 cshoq=2.817 ibq=-54.83 lctq=. ltq=1125.576 saleq=-70.092 seqq=676.583

teqq=744.457 txdbq=13.752 capxy=0 exchg=19 costat=A prccq=125.77 sic=6799 MVEQ=354.29409

MTBQ=0.5236520723 BTMQ=1.909664934 lnMVEQ=5.870127331 lnATQ=7.5337113568 Leverageq=0.6019016777

IBQ_ATQ=-0.029320338 Loss=1 lnsaleq=. _ERROR_=1 _N_=31037

NOTE: Invalid argument to function LOG(-189.836) at line 189 column 9.

gvkey=015082 datadate=31DEC2018 fyearq=2018 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2018Q4 datafqtr=2018Q4 rdq=29MAR2019 atq=2756.97 ceqq=864.636

cheq=121.017 chq=120.555 cshoq=2.689 ibq=-152.197 lctq=. ltq=1787.549 saleq=-190.836 seqq=864.636

teqq=969.421 txdbq=25.782 capxy=0 exchg=19 costat=A prccq=161.01 sic=6799 MVEQ=432.95589

MTBQ=0.5007377555 BTMQ=1.9970533257 lnMVEQ=6.0706358521 lnATQ=7.9218875296 Leverageq=0.6483744836

IBQ_ATQ=-0.055204445 Loss=1 lnsaleq=. _ERROR_=1 _N_=31048

NOTE: Invalid argument to function LOG(-37.16) at line 189 column 9.

gvkey=015082 datadate=30JUN2019 fyearq=2019 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2019Q2 datafqtr=2019Q2 rdq=12AUG2019 atq=2548.264 ceqq=825.661

cheq=18.074 chq=17.609 cshoq=2.676 ibq=-56.555 lctq=. ltq=1704.613 saleq=-38.16 seqq=825.661

teqq=843.651 txdbq=22.483 capxy=0 exchg=19 costat=A prccq=168.61 sic=6799 MVEQ=451.20036

MTBQ=0.5464716875 BTMQ=1.829920969 lnMVEQ=6.1119114981 lnATQ=7.843167622 Leverageq=0.6689310841

IBQ_ATQ=-0.02219354 Loss=1 lnsaleq=. _ERROR_=1 _N_=31050

NOTE: Invalid argument to function LOG(-350.373) at line 189 column 9.

gvkey=015082 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=1980.88 ceqq=639.374

cheq=17.261 chq=16.796 cshoq=2.634 ibq=-341.993 lctq=. ltq=1325.132 saleq=-351.373 seqq=639.374

teqq=655.748 txdbq=25.959 capxy=0 exchg=19 costat=A prccq=109.99 sic=6799 MVEQ=289.71366

MTBQ=0.4531208025 BTMQ=2.2069169952 lnMVEQ=5.6688930559 lnATQ=7.5912964694 Leverageq=0.6689612697

IBQ_ATQ=-0.172647005 Loss=1 lnsaleq=. _ERROR_=1 _N_=31053

NOTE: Invalid argument to function LOG(-222.641) at line 189 column 9.

gvkey=015101 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MFA

cusip=55272X102 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=16JUN2020 atq=11130.337 ceqq=2440.485

cheq=333.367 chq=116.465 cshoq=453.138 ibq=-908.995 lctq=. ltq=8689.662 saleq=-223.641 seqq=2440.675

teqq=2440.675 txdbq=0 capxy=0 exchg=11 costat=A prccq=1.55 sic=6798 MVEQ=702.3639 MTBQ=0.2877968519

BTMQ=3.4746731716 lnMVEQ=6.5544516458 lnATQ=9.3174297223 Leverageq=0.780718679 IBQ_ATQ=-0.081668237

Loss=1 lnsaleq=. _ERROR_=1 _N_=31193

NOTE: Invalid argument to function LOG(-33.625) at line 189 column 9.

gvkey=015452 datadate=30JUN2016 fyearq=2016 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q2 datafqtr=2016Q2 rdq=05AUG2016 atq=17.55 ceqq=4.35

cheq=0.847 chq=0.847 cshoq=244.247 ibq=-35.485 lctq=13.2 ltq=13.2 saleq=-34.625 seqq=4.35 teqq=4.35

txdbq=0 capxy=0 exchg=19 costat=A prccq=0.072 sic=1311 MVEQ=17.585784 MTBQ=4.0427089655

BTMQ=0.2473588894 lnMVEQ=2.8670908484 lnATQ=2.8650539499 Leverageq=0.7521367521 IBQ_ATQ=-2.021937322

Loss=1 lnsaleq=. _ERROR_=1 _N_=32451

NOTE: Invalid argument to function LOG(-9.899) at line 189 column 9.

gvkey=015452 datadate=30SEP2016 fyearq=2016 fqtr=3 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q3 datafqtr=2016Q3 rdq=07NOV2016 atq=6.323 ceqq=-5.13

cheq=0.847 chq=0.847 cshoq=251.645 ibq=-10.927 lctq=11.453 ltq=11.453 saleq=-10.899 seqq=-5.13

teqq=-5.13 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.045 sic=1311 MVEQ=11.324025 MTBQ=-2.207412281

BTMQ=-0.453019134 lnMVEQ=2.4269265749 lnATQ=1.8441937791 Leverageq=1.8113237387 IBQ_ATQ=-1.728135379

Loss=1 lnsaleq=. _ERROR_=1 _N_=32452

NOTE: Invalid argument to function LOG(-4.947) at line 189 column 9.

gvkey=016187 datadate=31MAR2017 fyearq=2017 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2017Q1 datafqtr=2017Q1 rdq=04MAY2017 atq=3852.675 ceqq=806.124

cheq=1475.115 chq=115.677 cshoq=0.264 ibq=-17.725 lctq=. ltq=3046.551 saleq=-5.947 seqq=806.124

teqq=806.124 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=8.2565229912 Leverageq=0.7907625221 IBQ_ATQ=-0.0046007 Loss=1 lnsaleq=. _ERROR_=1 _N_=34057

NOTE: Invalid argument to function LOG(-2.939) at line 189 column 9.

gvkey=016187 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=06MAY2020 atq=1484.296 ceqq=667.972

cheq=909.717 chq=131.826 cshoq=0.264 ibq=-7.591 lctq=. ltq=816.324 saleq=-3.939 seqq=667.972

teqq=667.972 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=7.3026958648 Leverageq=0.5499738597 IBQ_ATQ=-0.005114209 Loss=1 lnsaleq=. _ERROR_=1 _N_=34069

NOTE: Invalid argument to function LOG(-1956) at line 189 column 9.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=016384 datadate=31MAR2021 fyearq=2021 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=VOYA

cusip=929089100 curcdq=USD datacqtr=2021Q1 datafqtr=2021Q1 rdq=10MAY2021 atq=162861 ceqq=7931

cheq=3182 chq=1316 cshoq=121.222 ibq=1086 lctq=. ltq=153862 saleq=-1957 seqq=7931 teqq=8999 txdbq=0

capxy=0 exchg=11 costat=A prccq=63.64 sic=6311 MVEQ=7714.56808 MTBQ=0.9727106393 BTMQ=1.0280549627

lnMVEQ=8.9508657788 lnATQ=12.000652355 Leverageq=0.9447442911 IBQ_ATQ=0.0066682631 Loss=0 lnsaleq=.

_ERROR_=1 _N_=34258

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      12941 at 178:12   13505 at 179:10   13505 at 180:10   12941 at 181:8    155 at 185:14

      624 at 186:12     1478 at 189:9     1478 at 189:14    

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 179:10   1 at 180:10    1 at 181:8     243 at 189:9   

NOTE: There were 251509 observations read from the data set DATA.COMPUSTAT_QUARTER.

NOTE: The data set WORK.QCOMPUSTAT has 167464 observations and 40 variables.

NOTE: DATA statement used (Total process time):

      real time           0.21 seconds

      cpu time            0.03 seconds

      



191  

192  proc sort nodupkey data=qcompustat; by gvkey datadate; run;



NOTE: There were 167464 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 93 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 40 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.09 seconds

      cpu time            0.09 seconds

      



193  

194  data qcompustat;

195  set qcompustat;

196  cusip6=substr(cusip,1,6);

197  lagCAPXY=lag(CAPXY);

198  if lag(gvkey) ne gvkey or 93<datadate-lag(datadate) or datadate-lag(datadate)<0 or fqtr-lag(fqtr)

198!  ne 1 then lagCAPXY=.;

199  if fqtr=1 then CAPXQ=CAPXY;

200  if fqtr=2 or fqtr=3 or fqtr=4 then CAPXQ=CAPXY-lagCAPXY;

201  CAPXQ_AT=CAPXQ/ATQ;

202  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 198:38       1 at 198:64       86 at 198:88      13800 at 200:47   15705 at 201:15

NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: DATA statement used (Total process time):

      real time           0.06 seconds

      cpu time            0.06 seconds

      



203  

204  proc sort data = qcompustat; by cusip6 datadate descending atq; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.12 seconds

      cpu time            0.12 seconds

      



205  

206  proc sort data = qcompustat nodupkey; by cusip6 datadate; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 266 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.14 seconds

      cpu time            0.12 seconds

      



207  

208  

209  /*merge with RepRisk*/

210  proc sql;

211  create table newsdata6 as

212  select a.*, b.*

213  from newsdata5 as a, qcompustat as b

214  where (a.cusip6 = b.cusip6) and (a.news_date-93)<b.datadate<a.news_date

215  order by a.cusip6, a.news_date, b.datadate desc;

WARNING: Variable cusip6 already exists on file WORK.NEWSDATA6.

NOTE: Table WORK.NEWSDATA6 created, with 34989 rows and 63 columns.



216  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.19 seconds

      cpu time            0.21 seconds

      



217  

218  proc sort nodupkey data=newsdata6; by cusip6 news_date; run;



NOTE: There were 34989 observations read from the data set WORK.NEWSDATA6.

NOTE: 311 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA6 has 34678 observations and 63 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.02 seconds

      cpu time            0.03 seconds

      



219  

220  data newsdata6;

221  set newsdata6;

222  if tic = "" then delete;

223  run;



NOTE: There were 34678 observations read from the data set WORK.NEWSDATA6.

NOTE: The data set WORK.NEWSDATA6 has 34678 observations and 63 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



224  

225  proc sort data = newsdata6 nodupkey out = test; by cusip6; run;



NOTE: There were 34678 observations read from the data set WORK.NEWSDATA6.

NOTE: 32551 observations with duplicate key values were deleted.

NOTE: The data set WORK.TEST has 2127 observations and 63 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



226  proc means data = newsdata6 sum; var md_issue1--md_issue3; run;



NOTE: There were 34678 observations read from the data set WORK.NEWSDATA6.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



227  

228  

229  /*delete confounding news within 10 day*/

230  data newsdata6;

231  set newsdata6;

232  if date_distance2>10;

233  run;



NOTE: There were 34678 observations read from the data set WORK.NEWSDATA6.

NOTE: The data set WORK.NEWSDATA6 has 15741 observations and 63 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.00 seconds

      



234  

235  proc sort data = newsdata6 nodupkey out = test; by cusip6; run;



NOTE: There were 15741 observations read from the data set WORK.NEWSDATA6.

NOTE: 13615 observations with duplicate key values were deleted.

NOTE: The data set WORK.TEST has 2126 observations and 63 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.00 seconds

      



236  proc means data = newsdata6 sum; var md_issue1--md_issue3; run;



NOTE: There were 15741 observations read from the data set WORK.NEWSDATA6.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



237  

238  

239  /*****************3. Merge with Safegraph data****************/

240  data safegraph; set data.safegraph_fips_daily; run;

NOTE: Data file DATA.SAFEGRAPH_FIPS_DAILY.DATA is in a format that is native to another host, or the 

      file encoding does not match the session encoding. Cross Environment Data Access will be used, 

      which might require additional CPU resources and might reduce performance.



NOTE: There were 169944921 observations read from the data set DATA.SAFEGRAPH_FIPS_DAILY.

NOTE: The data set WORK.SAFEGRAPH has 169944921 observations and 10 variables.

NOTE: DATA statement used (Total process time):

      real time           1:35.62

      cpu time            1:31.82

      



241  

242  proc freq data = safegraph; tables year; run;



NOTE: There were 169944921 observations read from the data set WORK.SAFEGRAPH.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           7.64 seconds

      cpu time            6.51 seconds

      



243  

244  data safegraph;

245  set safegraph;

246  if year > 2020 then delete;

247  keep stock_symbol fips totalvisits_day visitday;

248  run;



NOTE: There were 169944921 observations read from the data set WORK.SAFEGRAPH.

NOTE: The data set WORK.SAFEGRAPH has 145721444 observations and 4 variables.

NOTE: DATA statement used (Total process time):

      real time           11.99 seconds

      cpu time            10.64 seconds

      



249  

250  /*news ticker*/

251  data newsdata6_tic;

252  set newsdata6;

253  keep tic;

254  run;



NOTE: There were 15741 observations read from the data set WORK.NEWSDATA6.

NOTE: The data set WORK.NEWSDATA6_TIC has 15741 observations and 1 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



255  

256  proc sort nodupkey data=newsdata6_tic; by tic; run;



NOTE: There were 15741 observations read from the data set WORK.NEWSDATA6_TIC.

NOTE: 13614 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA6_TIC has 2127 observations and 1 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



257  

258  proc sql;

259  create table safe_news_tic as

260  select a.*, b.*

261  from newsdata6_tic as a, safegraph as b

262  where(a.tic=b.stock_symbol)

263  order by stock_symbol, fips, visitday;

NOTE: Table WORK.SAFE_NEWS_TIC created, with 103485184 rows and 5 columns.



264  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           30.22 seconds

      cpu time            55.29 seconds

      



265  

266  /***merge reprisk with safegraph, window [-10, 20]***/

267  proc sql;

268  create table sg_rep_10_20 as

269  select a.*, b.*

270  from newsdata6 as a, safe_news_tic as b

271  where (a.tic = b.tic) and (a.news_date-10)<=b.visitday<=(a.news_date+20)

272  order by tic, fips, news_date, visitday;

WARNING: Column named tic is duplicated in a select expression (or a view). Explicit references to it 

         will be to the first one.

WARNING: Variable tic already exists on file WORK.SG_REP_10_20.

NOTE: Table WORK.SG_REP_10_20 created, with 41053665 rows and 67 columns.



273  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1:28.62

      cpu time            1:34.71

      



274  

275  

276  data sg_rep_10_20;

277  set sg_rep_10_20;

278  nfips = fips*1;

279  if nfips = 9 then delete;

280  run;



NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).

      278:9   

NOTE: There were 41053665 observations read from the data set WORK.SG_REP_10_20.

NOTE: The data set WORK.SG_REP_10_20 has 40981878 observations and 68 variables.

NOTE: DATA statement used (Total process time):

      real time           24.11 seconds

      cpu time            19.50 seconds

      



281  

282  

283  proc sort data = sg_rep_10_20 nodupkey out = test; by gvkey; run;



NOTE: There were 40981878 observations read from the data set WORK.SG_REP_10_20.

NOTE: 40981627 observations with duplicate key values were deleted.

NOTE: The data set WORK.TEST has 251 observations and 68 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           13.70 seconds

      cpu time            14.71 seconds

      



284  proc sort data = sg_rep_10_20 nodupkey out = test; by gvkey news_date; run;



NOTE: There were 40981878 observations read from the data set WORK.SG_REP_10_20.

NOTE: 40979067 observations with duplicate key values were deleted.

NOTE: The data set WORK.TEST has 2811 observations and 68 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           15.73 seconds

      cpu time            17.92 seconds

      



285  proc means data = test sum; var md_issue1--md_issue3; run;



NOTE: There were 2811 observations read from the data set WORK.TEST.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



286  

287  

288  proc export data = sg_rep_10_20

289  outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\sg_rep_10_20.dta"

290  dbms = '' replace;

291  run;



NOTE: The export data set has 40981878 observations and 68 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\sg_rep_10_20.dta" file was 

      successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           1:26.07

      cpu time            37.00 seconds

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           21:35.31

      cpu time            7:42.56

      



===== 2_Spending.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



2    

3    

4    libname reprisk "F:\bdata\RepRisk";

NOTE: Libref REPRISK was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: F:\bdata\RepRisk

4  !                                     run;

5    libname data "H:\project\ESG News and Customer\Data";

NOTE: Libref DATA was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: H:\project\ESG News and Customer\Data

5  !                                                       run;

6    

7    /*******************1. Import and clean reprisk data********************/

8    data newsdata2;

9    set reprisk.repriskus2017_2020;

10   if index(related_countries,'United States of America') ge 1 then USnews=1;

11   if index(source_language,'English') ge 1 then news_english=1;

12   cusip6=substr(ISIN,3,6);

13   run;



NOTE: There were 6738982 observations read from the data set REPRISK.REPRISKUS2017_2020.

NOTE: The data set WORK.NEWSDATA2 has 6738982 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           7:37.22

      cpu time            1:21.11

      



14   

15   /*dropping duplications*/

16   proc sort nodupkey data=newsdata2 out=newsdata4;

17   by cusip6 news_date reprisk_story_id reprisk_substory_id;

18   run;



NOTE: There were 6738982 observations read from the data set WORK.NEWSDATA2.

NOTE: 6492899 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 18 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           22.86 seconds

      cpu time            18.45 seconds

      



19   

20   /*************construct E S G issues*****************/

21   data newsdata4;

22   set newsdata4;

23   

24   if kindex(related_issues,"Climate change")>0 then d_issue1=1;

25   if kindex(related_issues,"Other environmental issues")>0 then d_issue1=1;

26   if kindex(related_issues,"Waste issues")>0 then d_issue1=1;

27   if kindex(related_issues,"Overuse and wasting of resources")>0 then d_issue1=1;

28   if kindex(related_issues,"Impacts on landscapes, ecosystems and biodiversity")>0 then d_issue1=1;

29   if kindex(related_issues,"Local pollution")>0 then d_issue1=1;

30   if kindex(related_issues,"Animal mistreatment")>0 then d_issue1=1;

31   if d_issue1=. then d_issue1=0;

32   

33   if kindex(related_issues,"Child labor")>0 then d_issue2=1;

34   if kindex(related_issues,"Discrimination in employment")>0 then d_issue2=1;

35   if kindex(related_issues,"Forced labor")>0 then d_issue2=1;

36   if kindex(related_issues,"Human rights abuses and corporate complicity")>0 then d_issue2=1;

37   if kindex(related_issues,"Freedom of association and collective bargaining")>0 then d_issue2=1;

38   if kindex(related_issues,"Impacts on communities")>0 then d_issue2=1;

39   if kindex(related_issues,"Local participation issues")>0 then d_issue2=1;

40   if kindex(related_issues,"Occupational health and safety issues")>0 then d_issue2=1;

41   if kindex(related_issues,"Other social issues")>0 then d_issue2=1;

42   if kindex(related_issues,"Poor employment conditions")>0 then d_issue2=1;

43   if kindex(related_issues,"Social discrimination")>0 then d_issue2=1;

44   if d_issue2=. then d_issue2=0;

45   

46   if kindex(related_issues,"Anti-competitive practices")>0 then d_issue3=1;

47   if kindex(related_issues,"Corruption, bribery, extortion and money laundering")>0 then d_issue3=1

47 ! ;

48   if kindex(related_issues,"Executive compensation issues")>0 then d_issue3=1;

49   if kindex(related_issues,"Fraud")>0 then d_issue3=1;

50   if kindex(related_issues,"Misleading communication")>0 then d_issue3=1;

51   if kindex(related_issues,"Tax evasion")>0 then d_issue3=1;

52   if kindex(related_issues,"Tax optimization")>0 then d_issue3=1;

53   if kindex(related_issues,"Other issues")>0 then d_issue3=1;

54   if d_issue3=. then d_issue3=0;

55   

56   if kindex(related_issues,"Products (health and environmental issues")>0 then crosscutting=1;

57   if kindex(related_issues,"Controversial products and services")>0 then crosscutting=1;

58   if kindex(related_issues,"Supply chain issues")>0 then crosscutting=1;

59   if kindex(related_issues,"Violation of international standards")>0 then crosscutting=1;

60   if kindex(related_issues,"Violation of national legislation")>0 then crosscutting=1;

61   if crosscutting=. then crosscutting=0;

62   

63   if kindex(related_issues,"Child labor")>0 then employee=1;

64   if kindex(related_issues,"Discrimination in employment")>0 then employee=1;

65   if kindex(related_issues,"Forced labor")>0 then employee=1;

66   if kindex(related_issues,"Freedom of association and collective bargaining")>0 then employee=1;

67   if kindex(related_issues,"Occupational health and safety issues")>0 then employee=1;

68   if kindex(related_issues,"Poor employment conditions")>0 then employee=1;

69   

70   if kindex(related_issues,"Social discrimination")>0 then community=1;

71   if kindex(related_issues,"Human rights abuses and corporate complicity")>0 then community=1;

72   if kindex(related_issues,"Impacts on communities")>0 then community=1;

73   if kindex(related_issues,"Local participation issues")>0 then community=1;

74   if kindex(related_issues,"Other social issues")>0 then community=1;

75   

76   if community=. then community=0;

77   if employee=. then employee=0;

78   

79   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 24 variables.

NOTE: DATA statement used (Total process time):

      real time           6.73 seconds

      cpu time            6.37 seconds

      



80   

81   

82   /*****Get highest news category, novelty, reach, severity per news date****/

83   proc sort data = newsdata4;

84   by cusip6 news_date;

85   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 24 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           3.68 seconds

      cpu time            4.64 seconds

      



86   

87   proc means data = newsdata4 noprint;

88   by cusip6 news_date;

89   var d_issue1 d_issue2 d_issue3 crosscutting severity novelty reach employee community;

90   output out=newsdata4_2(drop=_type_ _freq_)

91   max=md_issue1 md_issue2 md_issue3 mcrosscutting mseverity mnovelty mreach memployee mcommunity;

92   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4_2 has 177511 observations and 11 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           1.44 seconds

      cpu time            1.40 seconds

      



93   

94   /*****Number of news each day*****/

95   proc sort data = newsdata4 nodupkey out = newsdata4_3;

96   by cusip6 news_date reprisk_story_id;

97   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: 46156 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA4_3 has 199927 observations and 24 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           3.03 seconds

      cpu time            3.81 seconds

      



98   

99   data newsdata4_3;

100  set newsdata4_3;

101  news = 1;

102  run;



NOTE: There were 199927 observations read from the data set WORK.NEWSDATA4_3.

NOTE: The data set WORK.NEWSDATA4_3 has 199927 observations and 25 variables.

NOTE: DATA statement used (Total process time):

      real time           1.49 seconds

      cpu time            1.43 seconds

      



103  

104  proc means data = newsdata4_3 noprint;

105  by cusip6 news_date;

106  var news;

107  output out = ndailynews(drop=_type_ _freq_) sum = ndailynews;

108  run;



NOTE: There were 199927 observations read from the data set WORK.NEWSDATA4_3.

NOTE: The data set WORK.NDAILYNEWS has 177511 observations and 3 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           1.22 seconds

      cpu time            1.20 seconds

      



109  

110  

111  /****Merge news chacracteristics and # of news together******/

112  data newsdata5;

113  merge newsdata4_2 ndailynews;

114  by cusip6 news_date;

115  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA4_2.

NOTE: There were 177511 observations read from the data set WORK.NDAILYNEWS.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 12 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



116  

117  /*Finding the distance between previous news and current news*/

118  proc sort data=newsdata5; by cusip6 news_date ; run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 12 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.05 seconds

      cpu time            0.07 seconds

      



119  

120  data newsdata5;

121  set newsdata5;

122  lagcusip6=lag(cusip6);

123  lagnews_date=lag(news_date);

124  if cusip6 ne lagcusip6 then lagnews_date=.;

125  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 14 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



126  

127  data newsdata5;

128  set newsdata5;

129  date_distance=news_date-lagnews_date;

130  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      6990 at 129:24   

NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 15 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



131  

132  /*Finding the distance between future news and current news*/

133  proc sort data=newsdata5; by cusip6 descending news_date; run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 15 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.05 seconds

      cpu time            0.07 seconds

      



134  

135  data newsdata5;

136  set newsdata5;

137  forcusip6=lag(cusip6);

138  fornews_date=lag(news_date);

139  if cusip6 ne forcusip6 then fornews_date=.;

140  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 17 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



141  

142  data newsdata5;

143  set newsdata5;

144  nextdate_distance=fornews_date-news_date;

145  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      6990 at 144:31   

NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.04 seconds

      



146  

147  

148  /*further clean the data*/

149  data newsdata5;

150  set newsdata5;

151  if cusip6=' ' then delete;

152  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



153  

154  data newsdata5;

155  set newsdata5;

156  date_distance2=date_distance;

157  if date_distance=. then date_distance2=100;

158  nextdate_distance2=nextdate_distance;

159  if nextdate_distance=. then nextdate_distance2=100;

160  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 20 variables.

NOTE: DATA statement used (Total process time):

      real time           0.04 seconds

      cpu time            0.04 seconds

      



161  

162  /*delete confounding news within 10 day and only keep news between 2018 to 2020*/

163  data newsdata5;

164  set newsdata5;

165  if date_distance2>10;

166  if year(news_date)<2018 then delete;

167  if year(news_date)>2020 then delete;

168  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 56544 observations and 20 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



169  

170  

171  

172  /*************2. Import Compustat data to merge with RepRisk***********/

173  data qcompustat;

174  set data.compustat_quarter;

175  if atq>0;

176  if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

177  MVEQ=(PRCCQ*CSHOQ);

178  MTBQ=MVEQ/CEQQ;

179  BTMQ=CEQQ/MVEQ;

180  lnMVEQ=log(MVEQ);

181  lnATQ=log(ATQ);

182  *LEVQ=(DLTTQ+DLCQ)/ATQ;

183  *LEV_MVEQ=(DLTTQ+DLCQ)/MVEQ;

184  Leverageq=LTQ/ATQ;

185  IBQ_ATQ=IBQ/ATQ;

186  if IBQ<0 and IBQ ne . then Loss=1;

187  if IBQ>=0 and IBQ ne . then Loss=0;

188  lnsaleq=log(1+saleq);

189  run;



NOTE: Invalid argument to function LOG(-0.198) at line 188 column 9.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ACMTA

cusip=004616207 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=30APR2020 atq=55.544 ceqq=28.126

cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639 lctq=. ltq=27.418 saleq=-1.198 seqq=28.126 teqq=28.126

txdbq=0 capxy=0.015 exchg=19 costat=A prccq=32.3 sic=6351 MVEQ=25.6462 MTBQ=0.9118324682

BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995 Leverageq=0.4936266743 IBQ_ATQ=-0.029508138

Loss=1 lnsaleq=. _ERROR_=1 _N_=243

NOTE: Invalid argument to function LOG(-0.091) at line 188 column 9.

gvkey=001790 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=AB.

cusip=043420108 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=26JUN2020 atq=29.565 ceqq=-20.591

cheq=2.976 chq=0.187 cshoq=2.837 ibq=-0.318 lctq=4.728 ltq=50.156 saleq=-1.091 seqq=-20.591

teqq=-20.591 txdbq=0.324 capxy=0.002 exchg=9 costat=A prccq=0.35 sic=6799 MVEQ=0.99295

MTBQ=-0.048222524 BTMQ=-20.73719724 lnMVEQ=-0.007074969 lnATQ=3.3865912293 Leverageq=1.6964654152

IBQ_ATQ=-0.010755961 Loss=1 lnsaleq=. _ERROR_=1 _N_=1691

NOTE: Invalid argument to function LOG(-9009) at line 188 column 9.

gvkey=002176 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=BRK.B

cusip=084670702 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=02MAY2020 atq=760448 ceqq=371565

cheq=144480 chq=42640 cshoq=2430.035 ibq=-49746 lctq=. ltq=385213 saleq=-9010 seqq=371565 teqq=375235

txdbq=. capxy=2968 exchg=11 costat=A prccq=182.83 sic=9997 MVEQ=444283.29905 MTBQ=1.1957081508

BTMQ=0.8363244821 lnMVEQ=13.004217699 lnATQ=13.541663012 Leverageq=0.5065606064 IBQ_ATQ=-0.065416702

Loss=1 lnsaleq=. _ERROR_=1 _N_=2441

NOTE: Invalid argument to function LOG(-4.5) at line 188 column 9.

gvkey=011729 datadate=31DEC2016 fyearq=2016 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2016Q4 datafqtr=2016Q4 rdq=07FEB2017 atq=6544.7 ceqq=3603.3

cheq=650.1 chq=149.8 cshoq=4.564 ibq=-46.9 lctq=. ltq=2807.5 saleq=-5.5 seqq=3603.3 teqq=3737.2

txdbq=0 capxy=4.3 exchg=11 costat=A prccq=836.05 sic=6351 MVEQ=3815.7322 MTBQ=1.0589549025

BTMQ=0.9443272775 lnMVEQ=8.2468878519 lnATQ=8.7864108408 Leverageq=0.4289730622 IBQ_ATQ=-0.007166104

Loss=1 lnsaleq=. _ERROR_=1 _N_=21894

NOTE: Invalid argument to function LOG(-69.6) at line 188 column 9.

gvkey=011729 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=3739.7 ceqq=3076.7

cheq=274 chq=136.4 cshoq=3.135 ibq=-129.7 lctq=. ltq=780.6 saleq=-70.6 seqq=3076.7 teqq=2959.1 txdbq=.

capxy=0 exchg=11 costat=A prccq=910 sic=6351 MVEQ=2852.85 MTBQ=0.9272434752 BTMQ=1.0784653943

lnMVEQ=7.9560737736 lnATQ=8.2267606733 Leverageq=0.2087333209 IBQ_ATQ=-0.034681926 Loss=1 lnsaleq=.

_ERROR_=1 _N_=21907

NOTE: Invalid argument to function LOG(-1.058) at line 188 column 9.

gvkey=011957 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=TOF.U

cusip=87725P105 curcdq=CAD datacqtr=2018Q2 datafqtr=2018Q2 rdq=20AUG2018 atq=14.763 ceqq=13.986

cheq=14.721 chq=0.261 cshoq=1.411 ibq=-2.336 lctq=0.777 ltq=0.777 saleq=-2.058 seqq=13.986 teqq=13.986

txdbq=0 capxy=0 exchg=7 costat=I prccq=10.97 sic=6199 MVEQ=15.47867 MTBQ=1.1067260117

BTMQ=0.9035660041 lnMVEQ=2.7394629472 lnATQ=2.6921240506 Leverageq=0.0526315789 IBQ_ATQ=-0.158233421

Loss=1 lnsaleq=. _ERROR_=1 _N_=22530

NOTE: Invalid argument to function LOG(-28) at line 188 column 9.

gvkey=013561 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MBI

cusip=55262C100 curcdq=USD datacqtr=2018Q2 datafqtr=2018Q2 rdq=08AUG2018 atq=8699 ceqq=1103 cheq=675

chq=197 cshoq=90.662 ibq=-146 lctq=. ltq=7584 saleq=-29 seqq=1103 teqq=1115 txdbq=0 capxy=0 exchg=11

costat=A prccq=9.04 sic=6351 MVEQ=819.58448 MTBQ=0.7430502992 BTMQ=1.3458039127 lnMVEQ=6.7087974801

lnATQ=9.0709633555 Leverageq=0.8718243476 IBQ_ATQ=-0.016783538 Loss=1 lnsaleq=. _ERROR_=1 _N_=26114

NOTE: Invalid argument to function LOG(-42) at line 188 column 9.

gvkey=013709 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=IEP

cusip=451100101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=24306 ceqq=3635 cheq=3257

chq=2381 cshoq=214.186 ibq=-1384 lctq=. ltq=14889 saleq=-43 seqq=3635 teqq=9417 txdbq=533 capxy=53

exchg=14 costat=A prccq=48.42 sic=9997 MVEQ=10370.88612 MTBQ=2.8530635818 BTMQ=0.3505004257

lnMVEQ=9.2467577479 lnATQ=10.098478512 Leverageq=0.6125647988 IBQ_ATQ=-0.056940673 Loss=1 lnsaleq=.

_ERROR_=1 _N_=26550

NOTE: Invalid argument to function LOG(-989) at line 188 column 9.

gvkey=014326 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ONEXF

cusip=68272K103 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=15MAY2020 atq=6184 ceqq=5904 cheq=813

chq=379 cshoq=99.159 ibq=-997 lctq=. ltq=280 saleq=-990 seqq=5904 teqq=5904 txdbq=. capxy=0 exchg=19

costat=A prccq=. sic=6799 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=. lnATQ=8.7297205903 Leverageq=0.0452781371

IBQ_ATQ=-0.16122251 Loss=1 lnsaleq=. _ERROR_=1 _N_=28182

NOTE: Invalid argument to function LOG(-98) at line 188 column 9.

gvkey=014824 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=CINF

cusip=172062101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=27APR2020 atq=23367 ceqq=8042 cheq=988

chq=486 cshoq=160.8 ibq=-1226 lctq=. ltq=15325 saleq=-99 seqq=8042 teqq=8042 txdbq=660 capxy=4

exchg=14 costat=A prccq=75.45 sic=6331 MVEQ=12132.36 MTBQ=1.5086247202 BTMQ=0.6628553719

lnMVEQ=9.403631542 lnATQ=10.05908005 Leverageq=0.6558394317 IBQ_ATQ=-0.052467155 Loss=1 lnsaleq=.

_ERROR_=1 _N_=30164

NOTE: Invalid argument to function LOG(-69.092) at line 188 column 9.

gvkey=015082 datadate=31MAR2016 fyearq=2016 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2016Q1 datafqtr=2016Q1 rdq=13MAY2016 atq=1870.033 ceqq=676.583

cheq=8.444 chq=7.986 cshoq=2.817 ibq=-54.83 lctq=. ltq=1125.576 saleq=-70.092 seqq=676.583

teqq=744.457 txdbq=13.752 capxy=0 exchg=19 costat=A prccq=125.77 sic=6799 MVEQ=354.29409

MTBQ=0.5236520723 BTMQ=1.909664934 lnMVEQ=5.870127331 lnATQ=7.5337113568 Leverageq=0.6019016777

IBQ_ATQ=-0.029320338 Loss=1 lnsaleq=. _ERROR_=1 _N_=31037

NOTE: Invalid argument to function LOG(-189.836) at line 188 column 9.

gvkey=015082 datadate=31DEC2018 fyearq=2018 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2018Q4 datafqtr=2018Q4 rdq=29MAR2019 atq=2756.97 ceqq=864.636

cheq=121.017 chq=120.555 cshoq=2.689 ibq=-152.197 lctq=. ltq=1787.549 saleq=-190.836 seqq=864.636

teqq=969.421 txdbq=25.782 capxy=0 exchg=19 costat=A prccq=161.01 sic=6799 MVEQ=432.95589

MTBQ=0.5007377555 BTMQ=1.9970533257 lnMVEQ=6.0706358521 lnATQ=7.9218875296 Leverageq=0.6483744836

IBQ_ATQ=-0.055204445 Loss=1 lnsaleq=. _ERROR_=1 _N_=31048

NOTE: Invalid argument to function LOG(-37.16) at line 188 column 9.

gvkey=015082 datadate=30JUN2019 fyearq=2019 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2019Q2 datafqtr=2019Q2 rdq=12AUG2019 atq=2548.264 ceqq=825.661

cheq=18.074 chq=17.609 cshoq=2.676 ibq=-56.555 lctq=. ltq=1704.613 saleq=-38.16 seqq=825.661

teqq=843.651 txdbq=22.483 capxy=0 exchg=19 costat=A prccq=168.61 sic=6799 MVEQ=451.20036

MTBQ=0.5464716875 BTMQ=1.829920969 lnMVEQ=6.1119114981 lnATQ=7.843167622 Leverageq=0.6689310841

IBQ_ATQ=-0.02219354 Loss=1 lnsaleq=. _ERROR_=1 _N_=31050

NOTE: Invalid argument to function LOG(-350.373) at line 188 column 9.

gvkey=015082 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=1980.88 ceqq=639.374

cheq=17.261 chq=16.796 cshoq=2.634 ibq=-341.993 lctq=. ltq=1325.132 saleq=-351.373 seqq=639.374

teqq=655.748 txdbq=25.959 capxy=0 exchg=19 costat=A prccq=109.99 sic=6799 MVEQ=289.71366

MTBQ=0.4531208025 BTMQ=2.2069169952 lnMVEQ=5.6688930559 lnATQ=7.5912964694 Leverageq=0.6689612697

IBQ_ATQ=-0.172647005 Loss=1 lnsaleq=. _ERROR_=1 _N_=31053

NOTE: Invalid argument to function LOG(-222.641) at line 188 column 9.

gvkey=015101 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MFA

cusip=55272X102 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=16JUN2020 atq=11130.337 ceqq=2440.485

cheq=333.367 chq=116.465 cshoq=453.138 ibq=-908.995 lctq=. ltq=8689.662 saleq=-223.641 seqq=2440.675

teqq=2440.675 txdbq=0 capxy=0 exchg=11 costat=A prccq=1.55 sic=6798 MVEQ=702.3639 MTBQ=0.2877968519

BTMQ=3.4746731716 lnMVEQ=6.5544516458 lnATQ=9.3174297223 Leverageq=0.780718679 IBQ_ATQ=-0.081668237

Loss=1 lnsaleq=. _ERROR_=1 _N_=31193

NOTE: Invalid argument to function LOG(-33.625) at line 188 column 9.

gvkey=015452 datadate=30JUN2016 fyearq=2016 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q2 datafqtr=2016Q2 rdq=05AUG2016 atq=17.55 ceqq=4.35

cheq=0.847 chq=0.847 cshoq=244.247 ibq=-35.485 lctq=13.2 ltq=13.2 saleq=-34.625 seqq=4.35 teqq=4.35

txdbq=0 capxy=0 exchg=19 costat=A prccq=0.072 sic=1311 MVEQ=17.585784 MTBQ=4.0427089655

BTMQ=0.2473588894 lnMVEQ=2.8670908484 lnATQ=2.8650539499 Leverageq=0.7521367521 IBQ_ATQ=-2.021937322

Loss=1 lnsaleq=. _ERROR_=1 _N_=32451

NOTE: Invalid argument to function LOG(-9.899) at line 188 column 9.

gvkey=015452 datadate=30SEP2016 fyearq=2016 fqtr=3 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q3 datafqtr=2016Q3 rdq=07NOV2016 atq=6.323 ceqq=-5.13

cheq=0.847 chq=0.847 cshoq=251.645 ibq=-10.927 lctq=11.453 ltq=11.453 saleq=-10.899 seqq=-5.13

teqq=-5.13 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.045 sic=1311 MVEQ=11.324025 MTBQ=-2.207412281

BTMQ=-0.453019134 lnMVEQ=2.4269265749 lnATQ=1.8441937791 Leverageq=1.8113237387 IBQ_ATQ=-1.728135379

Loss=1 lnsaleq=. _ERROR_=1 _N_=32452

NOTE: Invalid argument to function LOG(-4.947) at line 188 column 9.

gvkey=016187 datadate=31MAR2017 fyearq=2017 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2017Q1 datafqtr=2017Q1 rdq=04MAY2017 atq=3852.675 ceqq=806.124

cheq=1475.115 chq=115.677 cshoq=0.264 ibq=-17.725 lctq=. ltq=3046.551 saleq=-5.947 seqq=806.124

teqq=806.124 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=8.2565229912 Leverageq=0.7907625221 IBQ_ATQ=-0.0046007 Loss=1 lnsaleq=. _ERROR_=1 _N_=34057

NOTE: Invalid argument to function LOG(-2.939) at line 188 column 9.

gvkey=016187 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=06MAY2020 atq=1484.296 ceqq=667.972

cheq=909.717 chq=131.826 cshoq=0.264 ibq=-7.591 lctq=. ltq=816.324 saleq=-3.939 seqq=667.972

teqq=667.972 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=7.3026958648 Leverageq=0.5499738597 IBQ_ATQ=-0.005114209 Loss=1 lnsaleq=. _ERROR_=1 _N_=34069

NOTE: Invalid argument to function LOG(-1956) at line 188 column 9.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=016384 datadate=31MAR2021 fyearq=2021 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=VOYA

cusip=929089100 curcdq=USD datacqtr=2021Q1 datafqtr=2021Q1 rdq=10MAY2021 atq=162861 ceqq=7931

cheq=3182 chq=1316 cshoq=121.222 ibq=1086 lctq=. ltq=153862 saleq=-1957 seqq=7931 teqq=8999 txdbq=0

capxy=0 exchg=11 costat=A prccq=63.64 sic=6311 MVEQ=7714.56808 MTBQ=0.9727106393 BTMQ=1.0280549627

lnMVEQ=8.9508657788 lnATQ=12.000652355 Leverageq=0.9447442911 IBQ_ATQ=0.0066682631 Loss=0 lnsaleq=.

_ERROR_=1 _N_=34258

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      12941 at 177:12   13505 at 178:10   13505 at 179:10   12941 at 180:8    155 at 184:14

      624 at 185:12     1478 at 188:9     1478 at 188:14    

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 178:10   1 at 179:10    1 at 180:8     243 at 188:9   

NOTE: There were 251509 observations read from the data set DATA.COMPUSTAT_QUARTER.

NOTE: The data set WORK.QCOMPUSTAT has 167464 observations and 40 variables.

NOTE: DATA statement used (Total process time):

      real time           0.22 seconds

      cpu time            0.04 seconds

      



190  

191  proc sort nodupkey data=qcompustat; by gvkey datadate; run;



NOTE: There were 167464 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 93 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 40 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.11 seconds

      cpu time            0.12 seconds

      



192  

193  data qcompustat;

194  set qcompustat;

195  cusip6=substr(cusip,1,6);

196  lagCAPXY=lag(CAPXY);

197  if lag(gvkey) ne gvkey or 93<datadate-lag(datadate) or datadate-lag(datadate)<0 or fqtr-lag(fqtr)

197!  ne 1 then lagCAPXY=.;

198  if fqtr=1 then CAPXQ=CAPXY;

199  if fqtr=2 or fqtr=3 or fqtr=4 then CAPXQ=CAPXY-lagCAPXY;

200  CAPXQ_AT=CAPXQ/ATQ;

201  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 197:38       1 at 197:64       86 at 197:88      13800 at 199:47   15705 at 200:15

NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: DATA statement used (Total process time):

      real time           0.07 seconds

      cpu time            0.07 seconds

      



202  

203  proc sort data = qcompustat; by cusip6 datadate descending atq; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.13 seconds

      cpu time            0.15 seconds

      



204  

205  proc sort data = qcompustat nodupkey; by cusip6 datadate; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 266 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.13 seconds

      cpu time            0.15 seconds

      



206  

207  

208  /*merge with RepRisk*/

209  proc sql;

210  create table newsdata6 as

211  select a.*, b.*

212  from newsdata5 as a, qcompustat as b

213  where (a.cusip6 = b.cusip6) and (a.news_date-93)<b.datadate<a.news_date

214  order by a.cusip6, a.news_date, b.datadate desc;

WARNING: Variable cusip6 already exists on file WORK.NEWSDATA6.

NOTE: Table WORK.NEWSDATA6 created, with 15894 rows and 63 columns.



215  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.08 seconds

      cpu time            0.09 seconds

      



216  

217  proc sort nodupkey data=newsdata6; by cusip6 news_date; run;



NOTE: There were 15894 observations read from the data set WORK.NEWSDATA6.

NOTE: 153 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA6 has 15741 observations and 63 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.00 seconds

      



218  

219  data newsdata6;

220  set newsdata6;

221  if tic = "" then delete;

222  run;



NOTE: There were 15741 observations read from the data set WORK.NEWSDATA6.

NOTE: The data set WORK.NEWSDATA6 has 15741 observations and 63 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



223  

224  

225  /*****************3. Merge with Safegraph foot traffic and spending data****************/

226  data spend; set data.allspend;run;



NOTE: There were 112786895 observations read from the data set DATA.ALLSPEND.

NOTE: The data set WORK.SPEND has 112786895 observations and 4 variables.

NOTE: DATA statement used (Total process time):

      real time           14.37 seconds

      cpu time            5.01 seconds

      



227  data safegraph; set data.safegraph_fips_daily; run;

NOTE: Data file DATA.SAFEGRAPH_FIPS_DAILY.DATA is in a format that is native to another host, or the 

      file encoding does not match the session encoding. Cross Environment Data Access will be used, 

      which might require additional CPU resources and might reduce performance.



NOTE: There were 169944921 observations read from the data set DATA.SAFEGRAPH_FIPS_DAILY.

NOTE: The data set WORK.SAFEGRAPH has 169944921 observations and 10 variables.

NOTE: DATA statement used (Total process time):

      real time           1:48.81

      cpu time            1:43.10

      



228  

229  /*merge foot traffic and spending***/

230  data safegraph;

231  retain stock_symbol fips visitday totalvisits_day;

232  set safegraph;

233  nfips = fips*1;

234  if nfips = 9 then delete;

235  keep stock_symbol fips visitday totalvisits_day nfips;

236  run;



NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).

      233:9   

NOTE: There were 169944921 observations read from the data set WORK.SAFEGRAPH.

NOTE: The data set WORK.SAFEGRAPH has 169356066 observations and 5 variables.

NOTE: DATA statement used (Total process time):

      real time           15.65 seconds

      cpu time            13.85 seconds

      



237  

238  data spend;

239  set spend;

240  rename date=visitday;

241  nfips=fips*1;

242  run;



NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).

      241:7   

NOTE: There were 112786895 observations read from the data set WORK.SPEND.

NOTE: The data set WORK.SPEND has 112786895 observations and 5 variables.

NOTE: DATA statement used (Total process time):

      real time           9.22 seconds

      cpu time            8.37 seconds

      



243  

244  proc sql;

245  create table spend as select

246  a.*, b.totalvisits_day

247  from spend as a left join safegraph as b

248  on a.stock_symbol = b.stock_symbol

249  and a.nfips = b.nfips

250  and a.visitday = b.visitday

251  order by stock_symbol, nfips, visitday;

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this 

         is a possible data integrity problem.

NOTE: Table WORK.SPEND created, with 112786895 rows and 6 columns.



252  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1:16.42

      cpu time            2:07.61

      



253  

254  data spend;

255  set spend;

256  if year(visitday) > 2020 then delete;

257  run;



NOTE: There were 112786895 observations read from the data set WORK.SPEND.

NOTE: The data set WORK.SPEND has 74475388 observations and 6 variables.

NOTE: DATA statement used (Total process time):

      real time           11.62 seconds

      cpu time            10.95 seconds

      



258  

259  /*news ticker*/

260  data newsdata6_tic;

261  set newsdata6;

262  keep tic;

263  run;



NOTE: There were 15741 observations read from the data set WORK.NEWSDATA6.

NOTE: The data set WORK.NEWSDATA6_TIC has 15741 observations and 1 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



264  

265  proc sort nodupkey data=newsdata6_tic; by tic; run;



NOTE: There were 15741 observations read from the data set WORK.NEWSDATA6_TIC.

NOTE: 13614 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA6_TIC has 2127 observations and 1 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



266  

267  proc sql;

268  create table spend_news_tic as

269  select a.*, b.*

270  from newsdata6_tic as a, spend as b

271  where(a.tic=b.stock_symbol)

272  order by stock_symbol, fips, visitday;

NOTE: Table WORK.SPEND_NEWS_TIC created, with 55766689 rows and 7 columns.



273  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           15.25 seconds

      cpu time            24.54 seconds

      



274  

275  

276  /***merge reprisk with safegraph, window [-10, 20]***/

277  proc sql;

278  create table spend_rep_10_20 as

279  select a.*, b.*

280  from newsdata6 as a, spend_news_tic as b

281  where (a.tic = b.tic) and (a.news_date-10)<=b.visitday<=(a.news_date+20)

282  order by tic, fips, news_date, visitday;

WARNING: Column named tic is duplicated in a select expression (or a view). Explicit references to it 

         will be to the first one.

WARNING: Variable tic already exists on file WORK.SPEND_REP_10_20.

NOTE: Table WORK.SPEND_REP_10_20 created, with 23892211 rows and 69 columns.



283  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           56.03 seconds

      cpu time            59.50 seconds

      



284  

285  proc export data = spend_rep_10_20

286  outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\spend_rep_10_20.dta"

287  dbms = '' replace;

288  run;



NOTE: The export data set has 23892211 observations and 69 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\spend_rep_10_20.dta" file 

      was successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           48.19 seconds

      cpu time            21.46 seconds

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           23:30.09

      cpu time            8:20.14

      



===== 3_Stacked.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



2    

3    libname reprisk "F:\bdata\RepRisk";

NOTE: Libref REPRISK was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: F:\bdata\RepRisk

3  !                                     run;

4    libname data "H:\project\ESG News and Customer\Data";

NOTE: Libref DATA was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: H:\project\ESG News and Customer\Data

4  !                                                       run;

5    

6    /*******************1. Import and clean reprisk data********************/

7    data newsdata2;

8    set reprisk.repriskus2017_2020;

9    if index(related_countries,'United States of America') ge 1 then USnews=1;

10   if index(source_language,'English') ge 1 then news_english=1;

11   cusip6=substr(ISIN,3,6);

12   run;



NOTE: There were 6738982 observations read from the data set REPRISK.REPRISKUS2017_2020.

NOTE: The data set WORK.NEWSDATA2 has 6738982 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           7:36.75

      cpu time            55.81 seconds

      



13   

14   /*dropping duplications*/

15   proc sort nodupkey data=newsdata2 out=newsdata4;

16   by cusip6 news_date reprisk_story_id reprisk_substory_id;

17   run;



NOTE: There were 6738982 observations read from the data set WORK.NEWSDATA2.

NOTE: 6492899 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 18 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           23.66 seconds

      cpu time            19.82 seconds

      



18   

19   /*************construct E S G issues*****************/

20   data newsdata4;

21   set newsdata4;

22   

23   if kindex(related_issues,"Climate change")>0 then d_issue1=1;

24   if kindex(related_issues,"Other environmental issues")>0 then d_issue1=1;

25   if kindex(related_issues,"Waste issues")>0 then d_issue1=1;

26   if kindex(related_issues,"Overuse and wasting of resources")>0 then d_issue1=1;

27   if kindex(related_issues,"Impacts on landscapes, ecosystems and biodiversity")>0 then d_issue1=1;

28   if kindex(related_issues,"Local pollution")>0 then d_issue1=1;

29   if kindex(related_issues,"Animal mistreatment")>0 then d_issue1=1;

30   if d_issue1=. then d_issue1=0;

31   

32   if kindex(related_issues,"Child labor")>0 then d_issue2=1;

33   if kindex(related_issues,"Discrimination in employment")>0 then d_issue2=1;

34   if kindex(related_issues,"Forced labor")>0 then d_issue2=1;

35   if kindex(related_issues,"Human rights abuses and corporate complicity")>0 then d_issue2=1;

36   if kindex(related_issues,"Freedom of association and collective bargaining")>0 then d_issue2=1;

37   if kindex(related_issues,"Impacts on communities")>0 then d_issue2=1;

38   if kindex(related_issues,"Local participation issues")>0 then d_issue2=1;

39   if kindex(related_issues,"Occupational health and safety issues")>0 then d_issue2=1;

40   if kindex(related_issues,"Other social issues")>0 then d_issue2=1;

41   if kindex(related_issues,"Poor employment conditions")>0 then d_issue2=1;

42   if kindex(related_issues,"Social discrimination")>0 then d_issue2=1;

43   if d_issue2=. then d_issue2=0;

44   

45   if kindex(related_issues,"Anti-competitive practices")>0 then d_issue3=1;

46   if kindex(related_issues,"Corruption, bribery, extortion and money laundering")>0 then d_issue3=1

46 ! ;

47   if kindex(related_issues,"Executive compensation issues")>0 then d_issue3=1;

48   if kindex(related_issues,"Fraud")>0 then d_issue3=1;

49   if kindex(related_issues,"Misleading communication")>0 then d_issue3=1;

50   if kindex(related_issues,"Tax evasion")>0 then d_issue3=1;

51   if kindex(related_issues,"Tax optimization")>0 then d_issue3=1;

52   if kindex(related_issues,"Other issues")>0 then d_issue3=1;

53   if d_issue3=. then d_issue3=0;

54   

55   if kindex(related_issues,"Products (health and environmental issues")>0 then crosscutting=1;

56   if kindex(related_issues,"Controversial products and services")>0 then crosscutting=1;

57   if kindex(related_issues,"Supply chain issues")>0 then crosscutting=1;

58   if kindex(related_issues,"Violation of international standards")>0 then crosscutting=1;

59   if kindex(related_issues,"Violation of national legislation")>0 then crosscutting=1;

60   if crosscutting=. then crosscutting=0;

61   

62   if kindex(related_issues,"Child labor")>0 then employee=1;

63   if kindex(related_issues,"Discrimination in employment")>0 then employee=1;

64   if kindex(related_issues,"Forced labor")>0 then employee=1;

65   if kindex(related_issues,"Freedom of association and collective bargaining")>0 then employee=1;

66   if kindex(related_issues,"Occupational health and safety issues")>0 then employee=1;

67   if kindex(related_issues,"Poor employment conditions")>0 then employee=1;

68   

69   if kindex(related_issues,"Social discrimination")>0 then community=1;

70   if kindex(related_issues,"Human rights abuses and corporate complicity")>0 then community=1;

71   if kindex(related_issues,"Impacts on communities")>0 then community=1;

72   if kindex(related_issues,"Local participation issues")>0 then community=1;

73   if kindex(related_issues,"Other social issues")>0 then community=1;

74   

75   if community=. then community=0;

76   if employee=. then employee=0;

77   

78   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 24 variables.

NOTE: DATA statement used (Total process time):

      real time           6.92 seconds

      cpu time            6.51 seconds

      



79   

80   

81   /*****Get highest news category, novelty, reach, severity per news date****/

82   proc sort data = newsdata4;

83   by cusip6 news_date;

84   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4 has 246083 observations and 24 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           3.59 seconds

      cpu time            4.59 seconds

      



85   

86   proc means data = newsdata4 noprint;

87   by cusip6 news_date;

88   var d_issue1 d_issue2 d_issue3 crosscutting severity novelty reach employee community;

89   output out=newsdata4_2(drop=_type_ _freq_)

90   max=md_issue1 md_issue2 md_issue3 mcrosscutting mseverity mnovelty mreach memployee mcommunity;

91   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4_2 has 177511 observations and 11 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           1.60 seconds

      cpu time            1.51 seconds

      



92   

93   /*****Number of news each day*****/

94   proc sort data = newsdata4 nodupkey out = newsdata4_3;

95   by cusip6 news_date reprisk_story_id;

96   run;



NOTE: There were 246083 observations read from the data set WORK.NEWSDATA4.

NOTE: 46156 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA4_3 has 199927 observations and 24 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           3.00 seconds

      cpu time            4.14 seconds

      



97   

98   data newsdata4_3;

99   set newsdata4_3;

100  news = 1;

101  run;



NOTE: There were 199927 observations read from the data set WORK.NEWSDATA4_3.

NOTE: The data set WORK.NEWSDATA4_3 has 199927 observations and 25 variables.

NOTE: DATA statement used (Total process time):

      real time           1.45 seconds

      cpu time            1.29 seconds

      



102  

103  proc means data = newsdata4_3 noprint;

104  by cusip6 news_date;

105  var news;

106  output out = ndailynews(drop=_type_ _freq_) sum = ndailynews;

107  run;



NOTE: There were 199927 observations read from the data set WORK.NEWSDATA4_3.

NOTE: The data set WORK.NDAILYNEWS has 177511 observations and 3 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           1.23 seconds

      cpu time            1.06 seconds

      



108  

109  

110  /****Merge news chacracteristics and # of news together******/

111  data newsdata5;

112  merge newsdata4_2 ndailynews;

113  by cusip6 news_date;

114  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA4_2.

NOTE: There were 177511 observations read from the data set WORK.NDAILYNEWS.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 12 variables.

NOTE: DATA statement used (Total process time):

      real time           0.06 seconds

      cpu time            0.04 seconds

      



115  

116  /*Finding the distance between previous news and current news*/

117  proc sort data=newsdata5; by cusip6 news_date ; run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 12 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.05 seconds

      cpu time            0.09 seconds

      



118  

119  data newsdata5;

120  set newsdata5;

121  lagcusip6=lag(cusip6);

122  lagnews_date=lag(news_date);

123  if cusip6 ne lagcusip6 then lagnews_date=.;

124  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 14 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



125  

126  data newsdata5;

127  set newsdata5;

128  date_distance=news_date-lagnews_date;

129  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      6990 at 128:24   

NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 15 variables.

NOTE: DATA statement used (Total process time):

      real time           0.04 seconds

      cpu time            0.01 seconds

      



130  

131  /*Finding the distance between future news and current news*/

132  proc sort data=newsdata5; by cusip6 descending news_date; run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 15 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.07 seconds

      cpu time            0.09 seconds

      



133  

134  data newsdata5;

135  set newsdata5;

136  forcusip6=lag(cusip6);

137  fornews_date=lag(news_date);

138  if cusip6 ne forcusip6 then fornews_date=.;

139  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 17 variables.

NOTE: DATA statement used (Total process time):

      real time           0.04 seconds

      cpu time            0.03 seconds

      



140  

141  data newsdata5;

142  set newsdata5;

143  nextdate_distance=fornews_date-news_date;

144  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      6990 at 143:31   

NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.03 seconds

      



145  

146  

147  /*further clean the data*/

148  data newsdata5;

149  set newsdata5;

150  if cusip6=' ' then delete;

151  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.04 seconds

      



152  

153  data newsdata5;

154  set newsdata5;

155  date_distance2=date_distance;

156  if date_distance=. then date_distance2=100;

157  nextdate_distance2=nextdate_distance;

158  if nextdate_distance=. then nextdate_distance2=100;

159  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 177511 observations and 20 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



160  

161  /*delete confounding news within 10 day and only keep news between 2018 to 2020*/

162  data newsdata5;

163  set newsdata5;

164  if year(news_date)<2018 then delete;

165  if year(news_date)>2020 then delete;

166  run;



NOTE: There were 177511 observations read from the data set WORK.NEWSDATA5.

NOTE: The data set WORK.NEWSDATA5 has 129601 observations and 20 variables.

NOTE: DATA statement used (Total process time):

      real time           0.05 seconds

      cpu time            0.06 seconds

      



167  

168  

169  

170  /*************2. Import Compustat data to merge with RepRisk***********/

171  data qcompustat;

172  set data.compustat_quarter;

173  if atq>0;

174  if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

175  MVEQ=(PRCCQ*CSHOQ);

176  MTBQ=MVEQ/CEQQ;

177  BTMQ=CEQQ/MVEQ;

178  lnMVEQ=log(MVEQ);

179  lnATQ=log(ATQ);

180  *LEVQ=(DLTTQ+DLCQ)/ATQ;

181  *LEV_MVEQ=(DLTTQ+DLCQ)/MVEQ;

182  Leverageq=LTQ/ATQ;

183  IBQ_ATQ=IBQ/ATQ;

184  if IBQ<0 and IBQ ne . then Loss=1;

185  if IBQ>=0 and IBQ ne . then Loss=0;

186  lnsaleq=log(1+saleq);

187  run;



NOTE: Invalid argument to function LOG(-0.198) at line 186 column 9.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ACMTA

cusip=004616207 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=30APR2020 atq=55.544 ceqq=28.126

cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639 lctq=. ltq=27.418 saleq=-1.198 seqq=28.126 teqq=28.126

txdbq=0 capxy=0.015 exchg=19 costat=A prccq=32.3 sic=6351 MVEQ=25.6462 MTBQ=0.9118324682

BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995 Leverageq=0.4936266743 IBQ_ATQ=-0.029508138

Loss=1 lnsaleq=. _ERROR_=1 _N_=243

NOTE: Invalid argument to function LOG(-0.091) at line 186 column 9.

gvkey=001790 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=AB.

cusip=043420108 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=26JUN2020 atq=29.565 ceqq=-20.591

cheq=2.976 chq=0.187 cshoq=2.837 ibq=-0.318 lctq=4.728 ltq=50.156 saleq=-1.091 seqq=-20.591

teqq=-20.591 txdbq=0.324 capxy=0.002 exchg=9 costat=A prccq=0.35 sic=6799 MVEQ=0.99295

MTBQ=-0.048222524 BTMQ=-20.73719724 lnMVEQ=-0.007074969 lnATQ=3.3865912293 Leverageq=1.6964654152

IBQ_ATQ=-0.010755961 Loss=1 lnsaleq=. _ERROR_=1 _N_=1691

NOTE: Invalid argument to function LOG(-9009) at line 186 column 9.

gvkey=002176 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=BRK.B

cusip=084670702 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=02MAY2020 atq=760448 ceqq=371565

cheq=144480 chq=42640 cshoq=2430.035 ibq=-49746 lctq=. ltq=385213 saleq=-9010 seqq=371565 teqq=375235

txdbq=. capxy=2968 exchg=11 costat=A prccq=182.83 sic=9997 MVEQ=444283.29905 MTBQ=1.1957081508

BTMQ=0.8363244821 lnMVEQ=13.004217699 lnATQ=13.541663012 Leverageq=0.5065606064 IBQ_ATQ=-0.065416702

Loss=1 lnsaleq=. _ERROR_=1 _N_=2441

NOTE: Invalid argument to function LOG(-4.5) at line 186 column 9.

gvkey=011729 datadate=31DEC2016 fyearq=2016 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2016Q4 datafqtr=2016Q4 rdq=07FEB2017 atq=6544.7 ceqq=3603.3

cheq=650.1 chq=149.8 cshoq=4.564 ibq=-46.9 lctq=. ltq=2807.5 saleq=-5.5 seqq=3603.3 teqq=3737.2

txdbq=0 capxy=4.3 exchg=11 costat=A prccq=836.05 sic=6351 MVEQ=3815.7322 MTBQ=1.0589549025

BTMQ=0.9443272775 lnMVEQ=8.2468878519 lnATQ=8.7864108408 Leverageq=0.4289730622 IBQ_ATQ=-0.007166104

Loss=1 lnsaleq=. _ERROR_=1 _N_=21894

NOTE: Invalid argument to function LOG(-69.6) at line 186 column 9.

gvkey=011729 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=3739.7 ceqq=3076.7

cheq=274 chq=136.4 cshoq=3.135 ibq=-129.7 lctq=. ltq=780.6 saleq=-70.6 seqq=3076.7 teqq=2959.1 txdbq=.

capxy=0 exchg=11 costat=A prccq=910 sic=6351 MVEQ=2852.85 MTBQ=0.9272434752 BTMQ=1.0784653943

lnMVEQ=7.9560737736 lnATQ=8.2267606733 Leverageq=0.2087333209 IBQ_ATQ=-0.034681926 Loss=1 lnsaleq=.

_ERROR_=1 _N_=21907

NOTE: Invalid argument to function LOG(-1.058) at line 186 column 9.

gvkey=011957 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=TOF.U

cusip=87725P105 curcdq=CAD datacqtr=2018Q2 datafqtr=2018Q2 rdq=20AUG2018 atq=14.763 ceqq=13.986

cheq=14.721 chq=0.261 cshoq=1.411 ibq=-2.336 lctq=0.777 ltq=0.777 saleq=-2.058 seqq=13.986 teqq=13.986

txdbq=0 capxy=0 exchg=7 costat=I prccq=10.97 sic=6199 MVEQ=15.47867 MTBQ=1.1067260117

BTMQ=0.9035660041 lnMVEQ=2.7394629472 lnATQ=2.6921240506 Leverageq=0.0526315789 IBQ_ATQ=-0.158233421

Loss=1 lnsaleq=. _ERROR_=1 _N_=22530

NOTE: Invalid argument to function LOG(-28) at line 186 column 9.

gvkey=013561 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MBI

cusip=55262C100 curcdq=USD datacqtr=2018Q2 datafqtr=2018Q2 rdq=08AUG2018 atq=8699 ceqq=1103 cheq=675

chq=197 cshoq=90.662 ibq=-146 lctq=. ltq=7584 saleq=-29 seqq=1103 teqq=1115 txdbq=0 capxy=0 exchg=11

costat=A prccq=9.04 sic=6351 MVEQ=819.58448 MTBQ=0.7430502992 BTMQ=1.3458039127 lnMVEQ=6.7087974801

lnATQ=9.0709633555 Leverageq=0.8718243476 IBQ_ATQ=-0.016783538 Loss=1 lnsaleq=. _ERROR_=1 _N_=26114

NOTE: Invalid argument to function LOG(-42) at line 186 column 9.

gvkey=013709 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=IEP

cusip=451100101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=24306 ceqq=3635 cheq=3257

chq=2381 cshoq=214.186 ibq=-1384 lctq=. ltq=14889 saleq=-43 seqq=3635 teqq=9417 txdbq=533 capxy=53

exchg=14 costat=A prccq=48.42 sic=9997 MVEQ=10370.88612 MTBQ=2.8530635818 BTMQ=0.3505004257

lnMVEQ=9.2467577479 lnATQ=10.098478512 Leverageq=0.6125647988 IBQ_ATQ=-0.056940673 Loss=1 lnsaleq=.

_ERROR_=1 _N_=26550

NOTE: Invalid argument to function LOG(-989) at line 186 column 9.

gvkey=014326 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ONEXF

cusip=68272K103 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=15MAY2020 atq=6184 ceqq=5904 cheq=813

chq=379 cshoq=99.159 ibq=-997 lctq=. ltq=280 saleq=-990 seqq=5904 teqq=5904 txdbq=. capxy=0 exchg=19

costat=A prccq=. sic=6799 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=. lnATQ=8.7297205903 Leverageq=0.0452781371

IBQ_ATQ=-0.16122251 Loss=1 lnsaleq=. _ERROR_=1 _N_=28182

NOTE: Invalid argument to function LOG(-98) at line 186 column 9.

gvkey=014824 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=CINF

cusip=172062101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=27APR2020 atq=23367 ceqq=8042 cheq=988

chq=486 cshoq=160.8 ibq=-1226 lctq=. ltq=15325 saleq=-99 seqq=8042 teqq=8042 txdbq=660 capxy=4

exchg=14 costat=A prccq=75.45 sic=6331 MVEQ=12132.36 MTBQ=1.5086247202 BTMQ=0.6628553719

lnMVEQ=9.403631542 lnATQ=10.05908005 Leverageq=0.6558394317 IBQ_ATQ=-0.052467155 Loss=1 lnsaleq=.

_ERROR_=1 _N_=30164

NOTE: Invalid argument to function LOG(-69.092) at line 186 column 9.

gvkey=015082 datadate=31MAR2016 fyearq=2016 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2016Q1 datafqtr=2016Q1 rdq=13MAY2016 atq=1870.033 ceqq=676.583

cheq=8.444 chq=7.986 cshoq=2.817 ibq=-54.83 lctq=. ltq=1125.576 saleq=-70.092 seqq=676.583

teqq=744.457 txdbq=13.752 capxy=0 exchg=19 costat=A prccq=125.77 sic=6799 MVEQ=354.29409

MTBQ=0.5236520723 BTMQ=1.909664934 lnMVEQ=5.870127331 lnATQ=7.5337113568 Leverageq=0.6019016777

IBQ_ATQ=-0.029320338 Loss=1 lnsaleq=. _ERROR_=1 _N_=31037

NOTE: Invalid argument to function LOG(-189.836) at line 186 column 9.

gvkey=015082 datadate=31DEC2018 fyearq=2018 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2018Q4 datafqtr=2018Q4 rdq=29MAR2019 atq=2756.97 ceqq=864.636

cheq=121.017 chq=120.555 cshoq=2.689 ibq=-152.197 lctq=. ltq=1787.549 saleq=-190.836 seqq=864.636

teqq=969.421 txdbq=25.782 capxy=0 exchg=19 costat=A prccq=161.01 sic=6799 MVEQ=432.95589

MTBQ=0.5007377555 BTMQ=1.9970533257 lnMVEQ=6.0706358521 lnATQ=7.9218875296 Leverageq=0.6483744836

IBQ_ATQ=-0.055204445 Loss=1 lnsaleq=. _ERROR_=1 _N_=31048

NOTE: Invalid argument to function LOG(-37.16) at line 186 column 9.

gvkey=015082 datadate=30JUN2019 fyearq=2019 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2019Q2 datafqtr=2019Q2 rdq=12AUG2019 atq=2548.264 ceqq=825.661

cheq=18.074 chq=17.609 cshoq=2.676 ibq=-56.555 lctq=. ltq=1704.613 saleq=-38.16 seqq=825.661

teqq=843.651 txdbq=22.483 capxy=0 exchg=19 costat=A prccq=168.61 sic=6799 MVEQ=451.20036

MTBQ=0.5464716875 BTMQ=1.829920969 lnMVEQ=6.1119114981 lnATQ=7.843167622 Leverageq=0.6689310841

IBQ_ATQ=-0.02219354 Loss=1 lnsaleq=. _ERROR_=1 _N_=31050

NOTE: Invalid argument to function LOG(-350.373) at line 186 column 9.

gvkey=015082 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=1980.88 ceqq=639.374

cheq=17.261 chq=16.796 cshoq=2.634 ibq=-341.993 lctq=. ltq=1325.132 saleq=-351.373 seqq=639.374

teqq=655.748 txdbq=25.959 capxy=0 exchg=19 costat=A prccq=109.99 sic=6799 MVEQ=289.71366

MTBQ=0.4531208025 BTMQ=2.2069169952 lnMVEQ=5.6688930559 lnATQ=7.5912964694 Leverageq=0.6689612697

IBQ_ATQ=-0.172647005 Loss=1 lnsaleq=. _ERROR_=1 _N_=31053

NOTE: Invalid argument to function LOG(-222.641) at line 186 column 9.

gvkey=015101 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MFA

cusip=55272X102 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=16JUN2020 atq=11130.337 ceqq=2440.485

cheq=333.367 chq=116.465 cshoq=453.138 ibq=-908.995 lctq=. ltq=8689.662 saleq=-223.641 seqq=2440.675

teqq=2440.675 txdbq=0 capxy=0 exchg=11 costat=A prccq=1.55 sic=6798 MVEQ=702.3639 MTBQ=0.2877968519

BTMQ=3.4746731716 lnMVEQ=6.5544516458 lnATQ=9.3174297223 Leverageq=0.780718679 IBQ_ATQ=-0.081668237

Loss=1 lnsaleq=. _ERROR_=1 _N_=31193

NOTE: Invalid argument to function LOG(-33.625) at line 186 column 9.

gvkey=015452 datadate=30JUN2016 fyearq=2016 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q2 datafqtr=2016Q2 rdq=05AUG2016 atq=17.55 ceqq=4.35

cheq=0.847 chq=0.847 cshoq=244.247 ibq=-35.485 lctq=13.2 ltq=13.2 saleq=-34.625 seqq=4.35 teqq=4.35

txdbq=0 capxy=0 exchg=19 costat=A prccq=0.072 sic=1311 MVEQ=17.585784 MTBQ=4.0427089655

BTMQ=0.2473588894 lnMVEQ=2.8670908484 lnATQ=2.8650539499 Leverageq=0.7521367521 IBQ_ATQ=-2.021937322

Loss=1 lnsaleq=. _ERROR_=1 _N_=32451

NOTE: Invalid argument to function LOG(-9.899) at line 186 column 9.

gvkey=015452 datadate=30SEP2016 fyearq=2016 fqtr=3 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q3 datafqtr=2016Q3 rdq=07NOV2016 atq=6.323 ceqq=-5.13

cheq=0.847 chq=0.847 cshoq=251.645 ibq=-10.927 lctq=11.453 ltq=11.453 saleq=-10.899 seqq=-5.13

teqq=-5.13 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.045 sic=1311 MVEQ=11.324025 MTBQ=-2.207412281

BTMQ=-0.453019134 lnMVEQ=2.4269265749 lnATQ=1.8441937791 Leverageq=1.8113237387 IBQ_ATQ=-1.728135379

Loss=1 lnsaleq=. _ERROR_=1 _N_=32452

NOTE: Invalid argument to function LOG(-4.947) at line 186 column 9.

gvkey=016187 datadate=31MAR2017 fyearq=2017 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2017Q1 datafqtr=2017Q1 rdq=04MAY2017 atq=3852.675 ceqq=806.124

cheq=1475.115 chq=115.677 cshoq=0.264 ibq=-17.725 lctq=. ltq=3046.551 saleq=-5.947 seqq=806.124

teqq=806.124 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=8.2565229912 Leverageq=0.7907625221 IBQ_ATQ=-0.0046007 Loss=1 lnsaleq=. _ERROR_=1 _N_=34057

NOTE: Invalid argument to function LOG(-2.939) at line 186 column 9.

gvkey=016187 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=06MAY2020 atq=1484.296 ceqq=667.972

cheq=909.717 chq=131.826 cshoq=0.264 ibq=-7.591 lctq=. ltq=816.324 saleq=-3.939 seqq=667.972

teqq=667.972 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=7.3026958648 Leverageq=0.5499738597 IBQ_ATQ=-0.005114209 Loss=1 lnsaleq=. _ERROR_=1 _N_=34069

NOTE: Invalid argument to function LOG(-1956) at line 186 column 9.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=016384 datadate=31MAR2021 fyearq=2021 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=VOYA

cusip=929089100 curcdq=USD datacqtr=2021Q1 datafqtr=2021Q1 rdq=10MAY2021 atq=162861 ceqq=7931

cheq=3182 chq=1316 cshoq=121.222 ibq=1086 lctq=. ltq=153862 saleq=-1957 seqq=7931 teqq=8999 txdbq=0

capxy=0 exchg=11 costat=A prccq=63.64 sic=6311 MVEQ=7714.56808 MTBQ=0.9727106393 BTMQ=1.0280549627

lnMVEQ=8.9508657788 lnATQ=12.000652355 Leverageq=0.9447442911 IBQ_ATQ=0.0066682631 Loss=0 lnsaleq=.

_ERROR_=1 _N_=34258

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      12941 at 175:12   13505 at 176:10   13505 at 177:10   12941 at 178:8    155 at 182:14

      624 at 183:12     1478 at 186:9     1478 at 186:14    

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 176:10   1 at 177:10    1 at 178:8     243 at 186:9   

NOTE: There were 251509 observations read from the data set DATA.COMPUSTAT_QUARTER.

NOTE: The data set WORK.QCOMPUSTAT has 167464 observations and 40 variables.

NOTE: DATA statement used (Total process time):

      real time           0.23 seconds

      cpu time            0.07 seconds

      



188  

189  proc sort nodupkey data=qcompustat; by gvkey datadate; run;



NOTE: There were 167464 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 93 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 40 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.09 seconds

      cpu time            0.14 seconds

      



190  

191  data qcompustat;

192  set qcompustat;

193  cusip6=substr(cusip,1,6);

194  lagCAPXY=lag(CAPXY);

195  if lag(gvkey) ne gvkey or 93<datadate-lag(datadate) or datadate-lag(datadate)<0 or fqtr-lag(fqtr)

195!  ne 1 then lagCAPXY=.;

196  if fqtr=1 then CAPXQ=CAPXY;

197  if fqtr=2 or fqtr=3 or fqtr=4 then CAPXQ=CAPXY-lagCAPXY;

198  CAPXQ_AT=CAPXQ/ATQ;

199  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 195:38       1 at 195:64       86 at 195:88      13800 at 197:47   15705 at 198:15

NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: DATA statement used (Total process time):

      real time           0.08 seconds

      cpu time            0.07 seconds

      



200  

201  proc sort data = qcompustat; by cusip6 datadate descending atq; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.12 seconds

      cpu time            0.18 seconds

      



202  

203  proc sort data = qcompustat nodupkey; by cusip6 datadate; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 266 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.11 seconds

      cpu time            0.14 seconds

      



204  

205  

206  /*merge with RepRisk*/

207  proc sql;

208  create table newsdata6 as

209  select a.*, b.*

210  from newsdata5 as a, qcompustat as b

211  where (a.cusip6 = b.cusip6) and (a.news_date-93)<b.datadate<a.news_date

212  order by a.cusip6, a.news_date, b.datadate desc;

WARNING: Variable cusip6 already exists on file WORK.NEWSDATA6.

NOTE: Table WORK.NEWSDATA6 created, with 34989 rows and 63 columns.



213  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.16 seconds

      cpu time            0.21 seconds

      



214  

215  proc sort nodupkey data=newsdata6; by cusip6 news_date; run;



NOTE: There were 34989 observations read from the data set WORK.NEWSDATA6.

NOTE: 311 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA6 has 34678 observations and 63 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.04 seconds

      cpu time            0.03 seconds

      



216  

217  data newsdata6;

218  set newsdata6;

219  if tic = "" then delete;

220  run;



NOTE: There were 34678 observations read from the data set WORK.NEWSDATA6.

NOTE: The data set WORK.NEWSDATA6 has 34678 observations and 63 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



221  

222  

223  

224  /*****************3. Merge with Safegraph data****************/

225  data safegraph; set data.safegraph_fips_daily; run;

NOTE: Data file DATA.SAFEGRAPH_FIPS_DAILY.DATA is in a format that is native to another host, or the 

      file encoding does not match the session encoding. Cross Environment Data Access will be used, 

      which might require additional CPU resources and might reduce performance.



NOTE: There were 169944921 observations read from the data set DATA.SAFEGRAPH_FIPS_DAILY.

NOTE: The data set WORK.SAFEGRAPH has 169944921 observations and 10 variables.

NOTE: DATA statement used (Total process time):

      real time           1:52.42

      cpu time            1:44.26

      



226  

227  proc freq data = safegraph; tables year; run;



NOTE: Writing HTML Body file: sashtml.htm

NOTE: There were 169944921 observations read from the data set WORK.SAFEGRAPH.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           8.03 seconds

      cpu time            7.12 seconds

      



228  

229  data safegraph;

230  set safegraph;

231  if year > 2020 then delete;

232  keep stock_symbol fips totalvisits_day visitday;

233  run;



NOTE: There were 169944921 observations read from the data set WORK.SAFEGRAPH.

NOTE: The data set WORK.SAFEGRAPH has 145721444 observations and 4 variables.

NOTE: DATA statement used (Total process time):

      real time           12.06 seconds

      cpu time            10.01 seconds

      



234  

235  /*news ticker*/

236  data newsdata6_tic;

237  set newsdata6;

238  keep tic;

239  run;



NOTE: There were 34678 observations read from the data set WORK.NEWSDATA6.

NOTE: The data set WORK.NEWSDATA6_TIC has 34678 observations and 1 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



240  

241  proc sort nodupkey data=newsdata6_tic; by tic; run;



NOTE: There were 34678 observations read from the data set WORK.NEWSDATA6_TIC.

NOTE: 32550 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA6_TIC has 2128 observations and 1 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



242  

243  proc sql;

244  create table safe_news_tic as

245  select a.*, b.*

246  from newsdata6_tic as a, safegraph as b

247  where(a.tic=b.stock_symbol)

248  order by stock_symbol, fips, visitday;

NOTE: Table WORK.SAFE_NEWS_TIC created, with 105301750 rows and 5 columns.



249  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           32.87 seconds

      cpu time            55.20 seconds

      



250  

251  /***merge reprisk with safegraph, window [-10, 20]***/

252  proc sql;

253  create table stacked_rep_10_20 as

254  select a.*, b.*

255  from newsdata6 as a, safe_news_tic as b

256  where (a.tic = b.tic) and (a.news_date-10)<=b.visitday<=(a.news_date+20)

257  order by tic, fips, news_date, visitday;

WARNING: Column named tic is duplicated in a select expression (or a view). Explicit references to it 

         will be to the first one.

WARNING: Variable tic already exists on file WORK.STACKED_REP_10_20.

NOTE: Table WORK.STACKED_REP_10_20 created, with 185134189 rows and 67 columns.



258  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           6:25.21

      cpu time            6:47.67

      



259  

260  

261  data stacked_rep_10_20;

262  set stacked_rep_10_20;

263  nfips = fips*1;

264  if nfips = 9 then delete;

265  run;



NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).

      263:9   

NOTE: There were 185134189 observations read from the data set WORK.STACKED_REP_10_20.

NOTE: The data set WORK.STACKED_REP_10_20 has 184882687 observations and 68 variables.

NOTE: DATA statement used (Total process time):

      real time           1:47.64

      cpu time            1:23.73

      



266  

267  

268  proc export data = stacked_rep_10_20

269  outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and

269! Output\stacked_rep_10_20.dta"

270  dbms = '' replace;

271  run;



NOTE: The export data set has 184882687 observations and 68 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\stacked_rep_10_20.dta" file 

      was successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           6:31.40

      cpu time            2:44.15

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           1:50:34.36

      cpu time            16:08.81

      



===== 4_Graph_day_extended.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



5    

6    /**********1. Import safegraph data*************/

7    data safegraph; set data.safegraph_fips_daily; run;

NOTE: Data file DATA.SAFEGRAPH_FIPS_DAILY.DATA is in a format that is native to another host, or the 

      file encoding does not match the session encoding. Cross Environment Data Access will be used, 

      which might require additional CPU resources and might reduce performance.



NOTE: There were 169944921 observations read from the data set DATA.SAFEGRAPH_FIPS_DAILY.

NOTE: The data set WORK.SAFEGRAPH has 169944921 observations and 10 variables.

NOTE: DATA statement used (Total process time):

      real time           1:43.79

      cpu time            1:36.03

      



8    

9    /*proc freq data = safegraph; tables year; run;*/

10   

11   data safegraph;

12   set safegraph;

13   if year > 2020 then delete;

14   keep stock_symbol fips totalvisits_day visitday;

15   run;



NOTE: There were 169944921 observations read from the data set WORK.SAFEGRAPH.

NOTE: The data set WORK.SAFEGRAPH has 145721444 observations and 4 variables.

NOTE: DATA statement used (Total process time):

      real time           13.02 seconds

      cpu time            12.09 seconds

      



16   

17   data safegraph;

18   set safegraph;

19   nfips = fips*1;

20   run;



NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).

      19:9   

NOTE: There were 145721444 observations read from the data set WORK.SAFEGRAPH.

NOTE: The data set WORK.SAFEGRAPH has 145721444 observations and 5 variables.

NOTE: DATA statement used (Total process time):

      real time           12.95 seconds

      cpu time            11.87 seconds

      



21   

22   

23   /*****2. Import previously main sample******/

24   

25   proc import out  = sg_rep_10_20

26   datafile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\sg_rep_10_20.dta"

27   dbms = '' replace;

28   run;



NOTE: One or more variables were converted because the data type is not supported by the V9 engine. 

      For more details, run with options MSGLEVEL=I.

NOTE: The import data set has 40981878 observations and 68 variables.

NOTE: WORK.SG_REP_10_20 data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           1:49.13

      cpu time            42.68 seconds

      



29   

30   data newsday;

31   set sg_rep_10_20;

32   gap = abs(visitday - news_date);

33   drop visitday totalvisits_day;

34   run;



NOTE: There were 40981878 observations read from the data set WORK.SG_REP_10_20.

NOTE: The data set WORK.NEWSDAY has 40981878 observations and 67 variables.

NOTE: DATA statement used (Total process time):

      real time           22.75 seconds

      cpu time            16.48 seconds

      



35   

36   proc sort data = newsday; by gvkey news_date nfips gap; run;



NOTE: There were 40981878 observations read from the data set WORK.NEWSDAY.

NOTE: The data set WORK.NEWSDAY has 40981878 observations and 67 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           50.23 seconds

      cpu time            44.48 seconds

      



37   

38   proc sort data = newsday nodupkey; by gvkey nfips news_date; run;



NOTE: There were 40981878 observations read from the data set WORK.NEWSDAY.

NOTE: 39530949 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDAY has 1450929 observations and 67 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           18.53 seconds

      cpu time            19.36 seconds

      



39   

40   

41   /*2.1  -21 to -11*/

42   data newsday;

43   set newsday;

44   drop gap;

45   run;



NOTE: There were 1450929 observations read from the data set WORK.NEWSDAY.

NOTE: The data set WORK.NEWSDAY has 1450929 observations and 66 variables.

NOTE: DATA statement used (Total process time):

      real time           0.72 seconds

      cpu time            0.67 seconds

      



46   

47   proc sql;

48   create table day_n21_n11 as select

49   a.*, b.visitday, b.totalvisits_day

50   from newsday as a, safegraph as b

51   where a.tic = b.stock_symbol

52   and a.nfips = b.nfips

53   and b.visitday - a.news_date >= -21

54   and b.visitday - a.news_date <= -11

55   order by tic, news_date, fips, visitday;

NOTE: Table WORK.DAY_N21_N11 created, with 14417582 rows and 68 columns.



56   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1:49.24

      cpu time            2:23.32

      



57   

58   

59   /*2.2 /*21 to 60*/

60   proc sql;

61   create table day_p21_p60 as select

62   a.*, b.visitday, b.totalvisits_day

63   from newsday as a, safegraph as b

64   where a.tic = b.stock_symbol

65   and a.nfips = b.nfips

66   and b.visitday - a.news_date >= 21

67   and b.visitday - a.news_date <= 60

68   order by tic, news_date, fips, visitday;

NOTE: Table WORK.DAY_P21_P60 created, with 50510129 rows and 68 columns.



69   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           2:24.10

      cpu time            2:59.96

      



70   

71   data graph_extended_day;

72   set day_n21_n11 day_p21_p60;

73   run;



NOTE: There were 14417582 observations read from the data set WORK.DAY_N21_N11.

NOTE: There were 50510129 observations read from the data set WORK.DAY_P21_P60.

NOTE: The data set WORK.GRAPH_EXTENDED_DAY has 64927711 observations and 68 variables.

NOTE: DATA statement used (Total process time):

      real time           36.69 seconds

      cpu time            27.81 seconds

      



74   

75   proc export data = graph_extended_day

76   outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\graph_ext_day.dta"

77   dbms = '' replace;

78   run;



NOTE: The export data set has 64927711 observations and 68 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\graph_ext_day.dta" file was 

      successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           2:14.76

      cpu time            1:04.09

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           1:54:31.19

      cpu time            11:07.79

      



===== 5_Rep_CAR.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



2    

3    /******Reprisk CAR***********/

4    libname crsp "H:\Code&Data\Raw Data\crsp"; run;

WARNING: Apparent symbolic reference DATA not resolved.

NOTE: Libref CRSP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: H:\Code&Data\Raw Data\crsp

5    

6    

7    /***********1.Import Reprisk and get permno***********/

8    proc import out = ticnews

9    datafile = "H:\project\ESG News and Customer\Data\ticnewsdate1013.dta"

10   dbms = '' replace;

11   run;



NOTE: One or more variables were converted because the data type is not supported by the V9 engine. 

      For more details, run with options MSGLEVEL=I.

NOTE: The import data set has 2735 observations and 13 variables.

NOTE: WORK.TICNEWS data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.32 seconds

      cpu time            0.00 seconds

      



12   

13   data ticnews;

14   set ticnews;

15   gvkey1 = put(gvkey, z6.);

16   run;



NOTE: There were 2735 observations read from the data set WORK.TICNEWS.

NOTE: The data set WORK.TICNEWS has 2735 observations and 14 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.01 seconds

      



17   

18   proc sql;

19   create table rep as

20   select a.*, b.lpermno as permno

21   from ticnews as a, crsp.ccmxpf_lnkhist2023 as b

22   where a.gvkey1=b.gvkey and b.linkprim in ('P', 'C') and

23   b.LINKTYPE in ('LU', 'LC') and

24   a.news_date>= b.LINKDT and (a.news_date <= b.LINKENDDT or missing(b.LINKENDDT))

25   order by gvkey1, news_date;

NOTE: Data file CRSP.CCMXPF_LNKHIST2023.DATA is in a format that is native to another host, or the 

      file encoding does not match the session encoding. Cross Environment Data Access will be used, 

      which might require additional CPU resources and might reduce performance.

NOTE: Table WORK.REP created, with 2578 rows and 15 columns.



26   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.19 seconds

      cpu time            0.07 seconds

      



27   

28   

29   

30   

31   

32   

33   /***********2. Get CAR*************/

34   

35   /*calculate CAR first*/

36   %let wrds = wrds.wharton.upenn.edu 4016;options comamid = TCP remote=WRDS;

37   signon username=_prompt_;

WARNING: The SAS/CONNECT product with which the global statement 'signon' is associated will be 

         expiring soon, and is currently in warning mode to indicate this upcoming expiration. Please 

         run PROC SETINIT to obtain more information on your warning period.

NOTE: Remote signon to WRDS commencing (SAS Release 9.04.01M8P011823).

NOTE: SASPROPRIETARY encryption is being used to protect network traffic.

NOTE: The client session encoding wlatin1 does not match the server session encoding utf-8. This may 

      produce errors when moving some character data. Search "SAS/CONNECT Encoding Compatibility" for 

      details.

NOTE: Copyright (c) 2023 by SAS Institute Inc., Cary, NC, USA. 

NOTE: SAS (r) Proprietary Software 9.4 (TS1M8 MBCS3170) 

      Licensed to UNIVERSITY OF PENNSYLVANIA - SFA T&R, Site 70055201.

NOTE: This session is executing on the Linux 5.14.0-570.30.1.el9_6.x86_64 (LIN X64) platform.







NOTE: Analytical products:

      

      SAS/STAT 15.3

      SAS/ETS 15.3

      SAS/OR 15.3

      SAS/IML 15.3

      SAS/QC 15.3



NOTE: Additional host information:



 Linux LIN X64 5.14.0-570.30.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 30 15:58:22 UTC 2025 

      x86_64 Rocky Linux release 9.6 (Blue Onyx) 



      *** Welcome to Wharton Research Data Services (WRDS) ***



WRDS is developed and run by the Wharton School at the University of

Pennsylvania. We provide access to the databases that define empirical,

seminal research in the fields of accounting, banking, economics,

finance, insurance, management, marketing, public policy, risk

management, and statistics.



If you are not an authorized user of this system, disconnect now.

All activity is strictly monitored. There may be severe criminal and

civil penalties for unauthorized access or use of computing resources.



Please report any problems to wrds-support@wharton.upenn.edu.



----------------------------------------------------------------------------



             *** Wharton Research Data Services (WRDS) on SSRN ***



Submit to the WRDS Research Paper Series (RPS) on SSRN – a searchable repository of all papers 

submitted to SSRN that cite WRDS in their work. This RPS will elevate researchers’ visibility, 

increase your Eigenfactor® score, and build a specialized research base for others to explore easily.



  View Abstracts:            http://bit.ly/2qOrt9f

  Submit to the WRDS RPS:    http://bit.ly/2rjrENk



------------------------------------------------------------------------------



  *** NEW Learning Resources for Researchers, Instructors, and Librarians ***



Curated, guided, self-paced, competency-based access to our data, analytics, research, and technology 

solutions. In the classroom or at home, for 25+ years Wharton Research Data Services (WRDS) has 

supported users with targeted solutions that underpin research, reinforce learning, and enable 

discovery. Visit the WRDS website www.whartonwrds.com to view the full suite of Learning Pathways.



--------------------------------------------------------------------------------









NOTE: SAS initialization used:

      real time           0.40 seconds

      cpu time            0.07 seconds

      



NOTE: AUTOEXEC processing beginning; file is /home/uiowa/danye1993/autoexec.sas.



NOTE: Libref CRLCMACR was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/eventus/pgm/crlcmacr

NOTE: Libref VOLINDEX was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/eventus/sasdata

NOTE: Libref AHA was successfully assigned as follows: 

      Levels:           8

      Engine(1):        V9 

      Physical Name(1): /wrds/aha/sasdata/annual_survey

      Engine(2):        V9 

      Physical Name(2): /wrds/aha/sasdata/it_survey

      Engine(3):        V9 

      Physical Name(3): /wrds/aha/sasdata/hcris

      Engine(4):        V9 

      Physical Name(4): /wrds/aha/sasdata/annual_survey_3years

      Engine(5):        V9 

      Physical Name(5): /wrds/aha/sasdata/it_survey_3years

      Engine(6):        V9 

      Physical Name(6): /wrds/aha/sasdata/hcris_3years

      Engine(7):        V9 

      Physical Name(7): /wrds/aha/sasdata/annual_survey_history

      Engine(8):        V9 

      Physical Name(8): /wrds/aha/sasdata/common

NOTE: Libref AHASAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/aha

NOTE: Libref AUDIT was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/audit/sasdata/common

      Engine(2):        V9 

      Physical Name(2): /wrds/audit/sasdata/audit_comp

      Engine(3):        V9 

      Physical Name(3): /wrds/audit/sasdata/acct_os

      Engine(4):        V9 

      Physical Name(4): /wrds/audit/sasdata/corp_legal

      Engine(5):        V9 

      Physical Name(5): /wrds/audit/sasdata/europe

      Engine(6):        V9 

      Physical Name(6): /wrds/audit/sasdata/oia

      Engine(7):        V9 

      Physical Name(7): /wrds/audit/sasdata/sedar

NOTE: Libref AUDITSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/audit

NOTE: Libref BANK was successfully assigned as follows: 

      Levels:           8

      Engine(1):        V9 

      Physical Name(1): /wrds/bank/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/bank/sasdata/call

      Engine(3):        V9 

      Physical Name(3): /wrds/bank/sasdata/commercial

      Engine(4):        V9 

      Physical Name(4): /wrds/bank/sasdata/common

      Engine(5):        V9 

      Physical Name(5): /wrds/bank/sasdata/holding

      Engine(6):        V9 

      Physical Name(6): /wrds/bank/sasdata/linking

      Engine(7):        V9 

      Physical Name(7): /wrds/bank/sasdata/premium

      Engine(8):        V9 

      Physical Name(8): /wrds/bank/sasdata/structure

NOTE: Libref BANKSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/bank/premium

NOTE: Libref BLOCK was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/blockholders/sasdata

NOTE: Libref BOARDEX was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/boardex/sasdata/na

      Engine(2):        V9 

      Physical Name(2): /wrds/boardex/sasdata/eur

      Engine(3):        V9 

      Physical Name(3): /wrds/boardex/sasdata/uk

      Engine(4):        V9 

      Physical Name(4): /wrds/boardex/sasdata/row

NOTE: Libref BOARDSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/boardex

NOTE: Libref BVD was successfully assigned as follows: 

      Levels:           9

      Engine(1):        V9 

      Physical Name(1): /wrds/bvd/sasdata/ama_v

      Engine(2):        V9 

      Physical Name(2): /wrds/bvd/sasdata/ama_l

      Engine(3):        V9 

      Physical Name(3): /wrds/bvd/sasdata/ama_m

      Engine(4):        V9 

      Physical Name(4): /wrds/bvd/sasdata/ama_s

      Engine(5):        V9 

      Physical Name(5): /wrds/bvd/sasdata/bankf

      Engine(6):        V9 

      Physical Name(6): /wrds/bvd/sasdata/os

      Engine(7):        V9 

      Physical Name(7): /wrds/bvd/sasdata/bvdorbis/ob_l

      Engine(8):        V9 

      Physical Name(8): /wrds/bvd/sasdata/bvdorbis/ob_m

      Engine(9):        V9 

      Physical Name(9): /wrds/bvd/sasdata/bvdorbis/ob_s

NOTE: Libref BVDSAMP was successfully assigned as follows: 

      Levels:           3

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/bvd_ama

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/bvdbankf

      Engine(3):        V9 

      Physical Name(3): /wrds/samples/sasdata/bvdorbis

NOTE: Libref CANDID was successfully assigned as follows: 

      Levels:           3

      Engine(1):        V9 

      Physical Name(1): /wrds/candid/sasdata/candid_3_year

      Engine(2):        V9 

      Physical Name(2): /wrds/candid/sasdata/candid_6_year

      Engine(3):        V9 

      Physical Name(3): /wrds/candid/sasdata/candid_9_year

NOTE: Libref CALCBNCH was successfully assigned as follows: 

      Levels:           17

      Engine(1):        V9 

      Physical Name(1): /wrds/calcbench/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/calcbench/sasdata/ap_ar

      Engine(3):        V9 

      Physical Name(3): /wrds/calcbench/sasdata/business_combinations

      Engine(4):        V9 

      Physical Name(4): /wrds/calcbench/sasdata/commitment_contingency

      Engine(5):        V9 

      Physical Name(5): /wrds/calcbench/sasdata/concentration_risk

      Engine(6):        V9 

      Physical Name(6): /wrds/calcbench/sasdata/common

      Engine(7):        V9 

      Physical Name(7): /wrds/calcbench/sasdata/derivatives_hedging

      Engine(8):        V9 

      Physical Name(8): /wrds/calcbench/sasdata/discontinued_ops

      Engine(9):        V9 

      Physical Name(9): /wrds/calcbench/sasdata/equity_investments

      Engine(10):        V9 

      Physical Name(10): /wrds/calcbench/sasdata/equity_compensation

      Engine(11):        V9 

      Physical Name(11): /wrds/calcbench/sasdata/fair_value

      Engine(12):        V9 

      Physical Name(12): /wrds/calcbench/sasdata/business_segments

      Engine(13):        V9 

      Physical Name(13): /wrds/calcbench/sasdata/goodwill

      Engine(14):        V9 

      Physical Name(14): /wrds/calcbench/sasdata/income_tax

      Engine(15):        V9 

      Physical Name(15): /wrds/calcbench/sasdata/inventory

      Engine(16):        V9 

      Physical Name(16): /wrds/calcbench/sasdata/leases

      Engine(17):        V9 

      Physical Name(17): /wrds/calcbench/sasdata/equity_repurchases

NOTE: Libref CALCSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/calcbench

NOTE: Libref CBOE was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/cboe/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/cboe/sasdata/options_eod

NOTE: Libref CBOESAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/cboe/options_eod

NOTE: Libref CDDSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/candid

NOTE: Libref CIQ was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/capitaliq/sasdata/helper

      Engine(2):        V9 

      Physical Name(2): /wrds/capitaliq/sasdata/pplintel

      Engine(3):        V9 

      Physical Name(3): /wrds/capitaliq/sasdata/keydev

      Engine(4):        V9 

      Physical Name(4): /wrds/capitaliq/sasdata/capstructure

      Engine(5):        V9 

      Physical Name(5): /wrds/capitaliq/sasdata/ratings

      Engine(6):        V9 

      Physical Name(6): /wrds/capitaliq/sasdata/transactions

      Engine(7):        V9 

      Physical Name(7): /wrds/capitaliq/sasdata/transcripts

NOTE: Libref CIQSAMP was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/ciqsamp/sasdata/capstructure

      Engine(2):        V9 

      Physical Name(2): /wrds/ciqsamp/sasdata/helper

      Engine(3):        V9 

      Physical Name(3): /wrds/ciqsamp/sasdata/keydev

      Engine(4):        V9 

      Physical Name(4): /wrds/ciqsamp/sasdata/pplintel

      Engine(5):        V9 

      Physical Name(5): /wrds/ciqsamp/sasdata/ratings

      Engine(6):        V9 

      Physical Name(6): /wrds/ciqsamp/sasdata/transactions

      Engine(7):        V9 

      Physical Name(7): /wrds/ciqsamp/sasdata/transcripts

NOTE: Libref CISDM was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/morningstar/sasdata/cisdm

NOTE: Libref CISDMSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/morningstar

NOTE: Libref COMPBD was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/comp/sasdata/d_bank

NOTE: Libref COMPB was successfully assigned as follows: 

      Levels:           1

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_bank

NOTE: Libref COMPGD was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_global

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_global/company

      Engine(3):        V9 

      Physical Name(3): /wrds/comp/sasdata/d_global/currency

      Engine(4):        V9 

      Physical Name(4): /wrds/comp/sasdata/d_global/dictionary

      Engine(5):        V9 

      Physical Name(5): /wrds/comp/sasdata/d_global/economy

      Engine(6):        V9 

      Physical Name(6): /wrds/comp/sasdata/d_global/index

      Engine(7):        V9 

      Physical Name(7): /wrds/comp/sasdata/d_global/security

NOTE: Libref COMPG was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_global

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_global/company

      Engine(3):        V9 

      Physical Name(3): /wrds/comp/sasdata/d_global/currency

      Engine(4):        V9 

      Physical Name(4): /wrds/comp/sasdata/d_global/dictionary

      Engine(5):        V9 

      Physical Name(5): /wrds/comp/sasdata/d_global/economy

      Engine(6):        V9 

      Physical Name(6): /wrds/comp/sasdata/d_global/index

      Engine(7):        V9 

      Physical Name(7): /wrds/comp/sasdata/d_global/security

NOTE: Libref COMPNAD was successfully assigned as follows: 

      Levels:           14

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_na

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_na/company

      Engine(3):        V9 

      Physical Name(3): /wrds/comp/sasdata/d_na/currency

      Engine(4):        V9 

      Physical Name(4): /wrds/comp/sasdata/d_na/dictionary

      Engine(5):        V9 

      Physical Name(5): /wrds/comp/sasdata/d_na/economy

      Engine(6):        V9 

      Physical Name(6): /wrds/comp/sasdata/d_na/index

      Engine(7):        V9 

      Physical Name(7): /wrds/comp/sasdata/d_na/industry

      Engine(8):        V9 

      Physical Name(8): /wrds/comp/sasdata/d_na/insider

      Engine(9):        V9 

      Physical Name(9): /wrds/comp/sasdata/d_na/institution

      Engine(10):        V9 

      Physical Name(10): /wrds/comp/sasdata/d_na/pension

      Engine(11):        V9 

      Physical Name(11): /wrds/comp/sasdata/d_na/rating

      Engine(12):        V9 

      Physical Name(12): /wrds/comp/sasdata/d_na/security

      Engine(13):        V9 

      Physical Name(13): /wrds/comp/sasdata/d_na/segments_current

      Engine(14):        V9 

      Physical Name(14): /wrds/comp/sasdata/d_na/transparency

NOTE: Libref COMPA was successfully assigned as follows: 

      Levels:           14

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_na

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_na/company

      Engine(3):        V9 

      Physical Name(3): /wrds/comp/sasdata/d_na/currency

      Engine(4):        V9 

      Physical Name(4): /wrds/comp/sasdata/d_na/dictionary

      Engine(5):        V9 

      Physical Name(5): /wrds/comp/sasdata/d_na/economy

      Engine(6):        V9 

      Physical Name(6): /wrds/comp/sasdata/d_na/index

      Engine(7):        V9 

      Physical Name(7): /wrds/comp/sasdata/d_na/industry

      Engine(8):        V9 

      Physical Name(8): /wrds/comp/sasdata/d_na/insider

      Engine(9):        V9 

      Physical Name(9): /wrds/comp/sasdata/d_na/institution

      Engine(10):        V9 

      Physical Name(10): /wrds/comp/sasdata/d_na/pension

      Engine(11):        V9 

      Physical Name(11): /wrds/comp/sasdata/d_na/rating

      Engine(12):        V9 

      Physical Name(12): /wrds/comp/sasdata/d_na/security

      Engine(13):        V9 

      Physical Name(13): /wrds/comp/sasdata/d_na/segments_current

      Engine(14):        V9 

      Physical Name(14): /wrds/comp/sasdata/d_na/transparency

NOTE: Libref COMPDCUR was successfully assigned as follows: 

      Levels:           22

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_na

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_na/company

      Engine(3):        V9 

      Physical Name(3): /wrds/comp/sasdata/d_na/currency

      Engine(4):        V9 

      Physical Name(4): /wrds/comp/sasdata/d_na/dictionary

      Engine(5):        V9 

      Physical Name(5): /wrds/comp/sasdata/d_na/economy

      Engine(6):        V9 

      Physical Name(6): /wrds/comp/sasdata/d_na/index

      Engine(7):        V9 

      Physical Name(7): /wrds/comp/sasdata/d_na/industry

      Engine(8):        V9 

      Physical Name(8): /wrds/comp/sasdata/d_na/insider

      Engine(9):        V9 

      Physical Name(9): /wrds/comp/sasdata/d_na/institution

      Engine(10):        V9 

      Physical Name(10): /wrds/comp/sasdata/d_na/pension

      Engine(11):        V9 

      Physical Name(11): /wrds/comp/sasdata/d_na/rating

      Engine(12):        V9 

      Physical Name(12): /wrds/comp/sasdata/d_na/security

      Engine(13):        V9 

      Physical Name(13): /wrds/comp/sasdata/d_na/segments_current

      Engine(14):        V9 

      Physical Name(14): /wrds/comp/sasdata/d_na/transparency

      Engine(15):        V9 

      Physical Name(15): /wrds/comp/sasdata/d_bank

      Engine(16):        V9 

      Physical Name(16): /wrds/comp/sasdata/d_global

      Engine(17):        V9 

      Physical Name(17): /wrds/comp/sasdata/d_global/company

      Engine(18):        V9 

      Physical Name(18): /wrds/comp/sasdata/d_global/currency

      Engine(19):        V9 

      Physical Name(19): /wrds/comp/sasdata/d_global/dictionary

      Engine(20):        V9 

      Physical Name(20): /wrds/comp/sasdata/d_global/economy

      Engine(21):        V9 

      Physical Name(21): /wrds/comp/sasdata/d_global/index

      Engine(22):        V9 

      Physical Name(22): /wrds/comp/sasdata/d_global/security

NOTE: Libref COMPSEGD was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_seghist

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_na

NOTE: Libref COMPSEG was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_seghist

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_na

NOTE: Libref EXECCOMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/comp/sasdata/execcomp

NOTE: Libref COMPD was successfully assigned as follows: 

      Levels:           22

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_na

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_na/company

      Engine(3):        V9 

      Physical Name(3): /wrds/comp/sasdata/d_na/currency

      Engine(4):        V9 

      Physical Name(4): /wrds/comp/sasdata/d_na/dictionary

      Engine(5):        V9 

      Physical Name(5): /wrds/comp/sasdata/d_na/economy

      Engine(6):        V9 

      Physical Name(6): /wrds/comp/sasdata/d_na/index

      Engine(7):        V9 

      Physical Name(7): /wrds/comp/sasdata/d_na/industry

      Engine(8):        V9 

      Physical Name(8): /wrds/comp/sasdata/d_na/insider

      Engine(9):        V9 

      Physical Name(9): /wrds/comp/sasdata/d_na/institution

      Engine(10):        V9 

      Physical Name(10): /wrds/comp/sasdata/d_na/pension

      Engine(11):        V9 

      Physical Name(11): /wrds/comp/sasdata/d_na/rating

      Engine(12):        V9 

      Physical Name(12): /wrds/comp/sasdata/d_na/security

      Engine(13):        V9 

      Physical Name(13): /wrds/comp/sasdata/d_na/segments_current

      Engine(14):        V9 

      Physical Name(14): /wrds/comp/sasdata/d_na/transparency

      Engine(15):        V9 

      Physical Name(15): /wrds/comp/sasdata/d_bank

      Engine(16):        V9 

      Physical Name(16): /wrds/comp/sasdata/d_global

      Engine(17):        V9 

      Physical Name(17): /wrds/comp/sasdata/d_global/company

      Engine(18):        V9 

      Physical Name(18): /wrds/comp/sasdata/d_global/currency

      Engine(19):        V9 

      Physical Name(19): /wrds/comp/sasdata/d_global/dictionary

      Engine(20):        V9 

      Physical Name(20): /wrds/comp/sasdata/d_global/economy

      Engine(21):        V9 

      Physical Name(21): /wrds/comp/sasdata/d_global/index

      Engine(22):        V9 

      Physical Name(22): /wrds/comp/sasdata/d_global/security

NOTE: Libref COMP was successfully assigned as follows: 

      Levels:           24

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/d_na

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/d_na/company

      Engine(3):        V9 

      Physical Name(3): /wrds/comp/sasdata/d_na/currency

      Engine(4):        V9 

      Physical Name(4): /wrds/comp/sasdata/d_na/dictionary

      Engine(5):        V9 

      Physical Name(5): /wrds/comp/sasdata/d_na/economy

      Engine(6):        V9 

      Physical Name(6): /wrds/comp/sasdata/d_na/index

      Engine(7):        V9 

      Physical Name(7): /wrds/comp/sasdata/d_na/industry

      Engine(8):        V9 

      Physical Name(8): /wrds/comp/sasdata/d_na/insider

      Engine(9):        V9 

      Physical Name(9): /wrds/comp/sasdata/d_na/institution

      Engine(10):        V9 

      Physical Name(10): /wrds/comp/sasdata/d_na/pension

      Engine(11):        V9 

      Physical Name(11): /wrds/comp/sasdata/d_na/rating

      Engine(12):        V9 

      Physical Name(12): /wrds/comp/sasdata/d_na/security

      Engine(13):        V9 

      Physical Name(13): /wrds/comp/sasdata/d_na/segments_current

      Engine(14):        V9 

      Physical Name(14): /wrds/comp/sasdata/d_na/transparency

      Engine(15):        V9 

      Physical Name(15): /wrds/comp/sasdata/d_bank

      Engine(16):        V9 

      Physical Name(16): /wrds/comp/sasdata/d_global

      Engine(17):        V9 

      Physical Name(17): /wrds/comp/sasdata/d_global/company

      Engine(18):        V9 

      Physical Name(18): /wrds/comp/sasdata/d_global/currency

      Engine(19):        V9 

      Physical Name(19): /wrds/comp/sasdata/d_global/dictionary

      Engine(20):        V9 

      Physical Name(20): /wrds/comp/sasdata/d_global/economy

      Engine(21):        V9 

      Physical Name(21): /wrds/comp/sasdata/d_global/index

      Engine(22):        V9 

      Physical Name(22): /wrds/comp/sasdata/d_global/security

      Engine(23):        V9 

      Physical Name(23): /wrds/comp/sasdata/execcomp

      Engine(24):        V9 

      Physical Name(24): /wrds/comp/sasdata/filings

NOTE: Libref COMPH was successfully assigned as follows: 

      Levels:           3

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/ph

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/pit

      Engine(3):        V9 

      Physical Name(3): /wrds/comp/sasdata/urq

NOTE: Libref COMPSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/compsamp/sasdata

NOTE: Libref COMPSNAP was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/comp/sasdata/snapshot

      Engine(2):        V9 

      Physical Name(2): /wrds/comp/sasdata/snapshot/dictionary

NOTE: Libref COMSCORE was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/comscore/sasdata

NOTE: Libref CONTRIB was successfully assigned as follows: 

      Levels:           17

      Engine(1):        V9 

      Physical Name(1): /wrds/contributors/sasdata/as_filed_financials

      Engine(2):        V9 

      Physical Name(2): /wrds/contributors/sasdata/better_market_beta

      Engine(3):        V9 

      Physical Name(3): /wrds/contributors/sasdata/blockholders_sv

      Engine(4):        V9 

      Physical Name(4): /wrds/contributors/sasdata/ceo_turnover

      Engine(5):        V9 

      Physical Name(5): /wrds/contributors/sasdata/characteristic_returns

      Engine(6):        V9 

      Physical Name(6): /wrds/contributors/sasdata/common_factors

      Engine(7):        V9 

      Physical Name(7): /wrds/contributors/sasdata/common_ownership

      Engine(8):        V9 

      Physical Name(8): /wrds/contributors/sasdata/global_factor

      Engine(9):        V9 

      Physical Name(9): /wrds/contributors/sasdata/green_returns

      Engine(10):        V9 

      Physical Name(10): /wrds/contributors/sasdata/intangible_value

      Engine(11):        V9 

      Physical Name(11): /wrds/contributors/sasdata/kpss_tech_innovation

      Engine(12):        V9 

      Physical Name(12): /wrds/contributors/sasdata/liva

      Engine(13):        V9 

      Physical Name(13): /wrds/contributors/sasdata/rq

      Engine(14):        V9 

      Physical Name(14): /wrds/contributors/sasdata/schwert_dealscan_link

      Engine(15):        V9 

      Physical Name(15): /wrds/contributors/sasdata/shale

      Engine(16):        V9 

      Physical Name(16): /wrds/contributors/sasdata/total_q

      Engine(17):        V9 

      Physical Name(17): /wrds/contributors/sasdata/marginal_tax

NOTE: Libref CRSPA was successfully assigned as follows: 

      Levels:           11

      Engine(1):        V9 

      Physical Name(1): /wrds/crsp/sasdata/a_stock

      Engine(2):        V9 

      Physical Name(2): /wrds/crsp/sasdata/a_stock_v2

      Engine(3):        V9 

      Physical Name(3): /wrds/crsp/sasdata/a_stock62

      Engine(4):        V9 

      Physical Name(4): /wrds/crsp/sasdata/a_stock62_v2

      Engine(5):        V9 

      Physical Name(5): /wrds/crsp/sasdata/a_indexes

      Engine(6):        V9 

      Physical Name(6): /wrds/crsp/sasdata/a_indexes_v2

      Engine(7):        V9 

      Physical Name(7): /wrds/crsp/sasdata/a_ccm

      Engine(8):        V9 

      Physical Name(8): /wrds/crsp/sasdata/a_treasuries

      Engine(9):        V9 

      Physical Name(9): /wrds/crsp/sasdata/a_treas_bd

      Engine(10):        V9 

      Physical Name(10): /wrds/crsp/sasdata/a_treas_bm

      Engine(11):        V9 

      Physical Name(11): /wrds/crsp/sasdata/a_ziman

NOTE: Libref CRSPQ was successfully assigned as follows: 

      Levels:           13

      Engine(1):        V9 

      Physical Name(1): /wrds/crsp/sasdata/q_stock

      Engine(2):        V9 

      Physical Name(2): /wrds/crsp/sasdata/q_stock_v2

      Engine(3):        V9 

      Physical Name(3): /wrds/crsp/sasdata/q_indexes

      Engine(4):        V9 

      Physical Name(4): /wrds/crsp/sasdata/q_indexes_v2

      Engine(5):        V9 

      Physical Name(5): /wrds/crsp/sasdata/q_mi_hist

      Engine(6):        V9 

      Physical Name(6): /wrds/crsp/sasdata/q_ccm

      Engine(7):        V9 

      Physical Name(7): /wrds/crsp/sasdata/q_mutualfunds

      Engine(8):        V9 

      Physical Name(8): /wrds/crsp/sasdata/q_stock62

      Engine(9):        V9 

      Physical Name(9): /wrds/crsp/sasdata/q_stock62_v2

      Engine(10):        V9 

      Physical Name(10): /wrds/crsp/sasdata/q_treasuries

      Engine(11):        V9 

      Physical Name(11): /wrds/crsp/sasdata/q_treas_bd

      Engine(12):        V9 

      Physical Name(12): /wrds/crsp/sasdata/q_treas_bm

      Engine(13):        V9 

      Physical Name(13): /wrds/crsp/sasdata/q_ziman

NOTE: Libref CRSPM was successfully assigned as follows: 

      Levels:           11

      Engine(1):        V9 

      Physical Name(1): /wrds/crsp/sasdata/m_stock

      Engine(2):        V9 

      Physical Name(2): /wrds/crsp/sasdata/m_stock_v2

      Engine(3):        V9 

      Physical Name(3): /wrds/crsp/sasdata/m_indexes

      Engine(4):        V9 

      Physical Name(4): /wrds/crsp/sasdata/m_indexes_v2

      Engine(5):        V9 

      Physical Name(5): /wrds/crsp/sasdata/m_ccm

      Engine(6):        V9 

      Physical Name(6): /wrds/crsp/sasdata/m_stock62

      Engine(7):        V9 

      Physical Name(7): /wrds/crsp/sasdata/m_stock62_v2

      Engine(8):        V9 

      Physical Name(8): /wrds/crsp/sasdata/m_treasuries

      Engine(9):        V9 

      Physical Name(9): /wrds/crsp/sasdata/m_treas_bd

      Engine(10):        V9 

      Physical Name(10): /wrds/crsp/sasdata/m_treas_bm

      Engine(11):        V9 

      Physical Name(11): /wrds/crsp/sasdata/m_ziman

NOTE: Libref CRSP was successfully assigned as follows: 

      Levels:           13

      Engine(1):        V9 

      Physical Name(1): /wrds/crsp/sasdata/a_stock

      Engine(2):        V9 

      Physical Name(2): /wrds/crsp/sasdata/a_stock_v2

      Engine(3):        V9 

      Physical Name(3): /wrds/crsp/sasdata/a_stock62

      Engine(4):        V9 

      Physical Name(4): /wrds/crsp/sasdata/a_stock62_v2

      Engine(5):        V9 

      Physical Name(5): /wrds/crsp/sasdata/a_indexes

      Engine(6):        V9 

      Physical Name(6): /wrds/crsp/sasdata/a_indexes_v2

      Engine(7):        V9 

      Physical Name(7): /wrds/crsp/sasdata/a_ccm

      Engine(8):        V9 

      Physical Name(8): /wrds/crsp/sasdata/a_treasuries

      Engine(9):        V9 

      Physical Name(9): /wrds/crsp/sasdata/a_treas_bd

      Engine(10):        V9 

      Physical Name(10): /wrds/crsp/sasdata/a_treas_bm

      Engine(11):        V9 

      Physical Name(11): /wrds/crsp/sasdata/a_ziman

      Engine(12):        V9 

      Physical Name(12): /wrds/crsp/sasdata/q_mutualfunds

      Engine(13):        V9 

      Physical Name(13): /wrds/crsp/sasdata/q_indexhist

NOTE: Libref CRSPSAMP was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/crspsamp/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/crsp_mf

NOTE: Libref CSMAR was successfully assigned as follows: 

      Levels:           12

      Engine(1):        V9 

      Physical Name(1): /wrds/csmar/sasdata/trading

      Engine(2):        V9 

      Physical Name(2): /wrds/csmar/sasdata/financial

      Engine(3):        V9 

      Physical Name(3): /wrds/csmar/sasdata/funds_mkt_research

      Engine(4):        V9 

      Physical Name(4): /wrds/csmar/sasdata/ma

      Engine(5):        V9 

      Physical Name(5): /wrds/csmar/sasdata/ipo_a

      Engine(6):        V9 

      Physical Name(6): /wrds/csmar/sasdata/af

      Engine(7):        V9 

      Physical Name(7): /wrds/csmar/sasdata/cd

      Engine(8):        V9 

      Physical Name(8): /wrds/csmar/sasdata/cg

      Engine(9):        V9 

      Physical Name(9): /wrds/csmar/sasdata/ini

      Engine(10):        V9 

      Physical Name(10): /wrds/csmar/sasdata/colc

      Engine(11):        V9 

      Physical Name(11): /wrds/csmar/sasdata/rs

      Engine(12):        V9 

      Physical Name(12): /wrds/csmar/sasdata/hld

NOTE: Libref CUSIPM was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/cusip/sasdata

NOTE: Libref DANDB was successfully assigned as follows: 

      Levels:           8

      Engine(1):        V9 

      Physical Name(1): /wrds/tfn/sasdata/dandb_dmi_us

      Engine(2):        V9 

      Physical Name(2): /wrds/tfn/sasdata/dandb_wb_af

      Engine(3):        V9 

      Physical Name(3): /wrds/tfn/sasdata/dandb_wb_ap

      Engine(4):        V9 

      Physical Name(4): /wrds/tfn/sasdata/dandb_wb_eu

      Engine(5):        V9 

      Physical Name(5): /wrds/tfn/sasdata/dandb_wb_la

      Engine(6):        V9 

      Physical Name(6): /wrds/tfn/sasdata/dandb_wb_me

      Engine(7):        V9 

      Physical Name(7): /wrds/tfn/sasdata/dandb_wb_na

      Engine(8):        V9 

      Physical Name(8): /wrds/tfn/sasdata/dandb_wb_unknown

NOTE: Libref DEALSCAN was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/tfn/sasdata/dealscan

NOTE: Libref DJONES was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/djones/sasdata

NOTE: Libref DMEF was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/dmef/sasdata

NOTE: Libref DOE was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/doe/sasdata

NOTE: Libref ESTIMIZE was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/estimize/sasdata

NOTE: Libref ETFG was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/etfg/sasdata/industry

      Engine(2):        V9 

      Physical Name(2): /wrds/etfg/sasdata/fund_flow

      Engine(3):        V9 

      Physical Name(3): /wrds/etfg/sasdata/analytics

      Engine(4):        V9 

      Physical Name(4): /wrds/etfg/sasdata/constituents

NOTE: Libref ETFGSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/etfg

NOTE: Libref FACTSET was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/factset/sasdata/common

      Engine(2):        V9 

      Physical Name(2): /wrds/factset/sasdata/own_v5

      Engine(3):        V9 

      Physical Name(3): /wrds/factset/sasdata/ff_usc_v3

      Engine(4):        V9 

      Physical Name(4): /wrds/factset/sasdata/ff_int_v3

NOTE: Libref FSSAMP was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/factset

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/revere

NOTE: Libref FF was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/ff/sasdata

NOTE: Libref FISD was successfully assigned as follows: 

      Levels:           3

      Engine(1):        V9 

      Physical Name(1): /wrds/mergent/sasdata/fisd

      Engine(2):        V9 

      Physical Name(2): /wrds/mergent/sasdata/naic

      Engine(3):        V9 

      Physical Name(3): /wrds/mergent/sasdata/common

NOTE: Libref FISDSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/fisdsamp/sasdata

NOTE: Libref FJC was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/fjc/sasdata/litigation

      Engine(2):        V9 

      Physical Name(2): /wrds/fjc/sasdata/linking

NOTE: Libref FTSE was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/ftse/sasdata/russell

NOTE: Libref FTSESAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/ftse

NOTE: Libref FRB was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/frb/sasdata

NOTE: Libref GMI was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/gmiratings/sasdata

NOTE: Libref HFR was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/hfr/sasdata/hfrdb_academic_dead

      Engine(2):        V9 

      Physical Name(2): /wrds/hfr/sasdata/hfrdb_academic_live

      Engine(3):        V9 

      Physical Name(3): /wrds/hfr/sasdata/hfrdb_dead

      Engine(4):        V9 

      Physical Name(4): /wrds/hfr/sasdata/hfrdb_live

NOTE: Libref HFRSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/hfrsamp/sasdata/hfrdb

NOTE: Libref IBES was successfully assigned as follows: 

      Levels:           3

      Engine(1):        V9 

      Physical Name(1): /wrds/ibes/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/ibes/sasdata/iga

      Engine(3):        V9 

      Physical Name(3): /wrds/ibes/sasdata/guidance

NOTE: Libref IBESKPI was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/ibes/sasdata/kpi

NOTE: Libref IFGR was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/infogroup/sasdata/business

      Engine(2):        V9 

      Physical Name(2): /wrds/infogroup/sasdata/residential

NOTE: Libref IFGRSAMP was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/infogroup/business

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/infogroup/residential

NOTE: Libref INSDSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/insiders

NOTE: Libref IRI was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/iri/sasdata

NOTE: Libref ISS was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/riskmetrics/sasdata/incentive_lab

      Engine(2):        V9 

      Physical Name(2): /wrds/riskmetrics/sasdata/incentive_lab/europe

NOTE: Libref ISSM was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/issm/sasdata

NOTE: Libref KLD was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/kld/sasdata

NOTE: Libref KPISAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/ibeskpi

NOTE: Libref LSPD was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/lspd/sasdata/monthly

      Engine(2):        V9 

      Physical Name(2): /wrds/lspd/sasdata/daily

NOTE: Libref LSPDSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/lspd

NOTE: Libref MARKIT was successfully assigned as follows: 

      Levels:           10

      Engine(1):        V9 

      Physical Name(1): /wrds/markit/sasdata/cds

      Engine(2):        V9 

      Physical Name(2): /wrds/markit/sasdata/red

      Engine(3):        V9 

      Physical Name(3): /wrds/markit/sasdata/cdx_composites

      Engine(4):        V9 

      Physical Name(4): /wrds/markit/sasdata/cdx_constituents

      Engine(5):        V9 

      Physical Name(5): /wrds/markit/sasdata/itraxx_asia_composites

      Engine(6):        V9 

      Physical Name(6): /wrds/markit/sasdata/itraxx_europe_composites

      Engine(7):        V9 

      Physical Name(7): /wrds/markit/sasdata/itraxx_sovx_composites

      Engine(8):        V9 

      Physical Name(8): /wrds/markit/sasdata/itraxx_asia_constituents

      Engine(9):        V9 

      Physical Name(9): /wrds/markit/sasdata/itraxx_europe_constituents

      Engine(10):        V9 

      Physical Name(10): /wrds/markit/sasdata/itraxx_sovx_constituents

NOTE: Libref MFL was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/mfl/sasdata

NOTE: Libref MIDAS was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/midas/sasdata

NOTE: Libref MRKTSAMP was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/markit/cdsred

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/markit/cdx

      Engine(3):        V9 

      Physical Name(3): /wrds/samples/sasdata/markit/msfa

      Engine(4):        V9 

      Physical Name(4): /wrds/samples/sasdata/markit/msfi

NOTE: Libref MSCIESG was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/msci/sasdata

NOTE: Libref MSCIESMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/msci

NOTE: Libref MSFANLY was successfully assigned as follows: 

      Levels:           5

      Engine(1):        V9 

      Physical Name(1): /wrds/markit/sasdata/msf_analytics_bonds

      Engine(2):        V9 

      Physical Name(2): /wrds/markit/sasdata/msf_analytics_eqty_amer

      Engine(3):        V9 

      Physical Name(3): /wrds/markit/sasdata/msf_analytics_eqty_euro

      Engine(4):        V9 

      Physical Name(4): /wrds/markit/sasdata/msf_analytics_eqty_asia

      Engine(5):        V9 

      Physical Name(5): /wrds/markit/sasdata/msf_analytics_eqty_other

NOTE: Libref MSFINST was successfully assigned as follows: 

      Levels:           5

      Engine(1):        V9 

      Physical Name(1): /wrds/markit/sasdata/msf_inst_bonds

      Engine(2):        V9 

      Physical Name(2): /wrds/markit/sasdata/msf_inst_eqty_amer

      Engine(3):        V9 

      Physical Name(3): /wrds/markit/sasdata/msf_inst_eqty_asia

      Engine(4):        V9 

      Physical Name(4): /wrds/markit/sasdata/msf_inst_eqty_euro

      Engine(5):        V9 

      Physical Name(5): /wrds/markit/sasdata/msf_inst_eqty_other

NOTE: Libref MSRB was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/msrb/sasdata

NOTE: Libref MSRBSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/msrb

NOTE: Libref NASTRAQ was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/nastraq/sasdata

NOTE: Libref OMTRIAL was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/optionmetrics

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/optionmetrics/europe

NOTE: Libref OPTIONM was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/optionm/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/optionm/sasdata/europe

NOTE: Libref OTC was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/otc/sasdata/endofday

NOTE: Libref PACAP was successfully assigned as follows: 

      Levels:           8

      Engine(1):        V9 

      Physical Name(1): /wrds/pacap/sasdata/hk

      Engine(2):        V9 

      Physical Name(2): /wrds/pacap/sasdata/id

      Engine(3):        V9 

      Physical Name(3): /wrds/pacap/sasdata/ja

      Engine(4):        V9 

      Physical Name(4): /wrds/pacap/sasdata/ks

      Engine(5):        V9 

      Physical Name(5): /wrds/pacap/sasdata/my

      Engine(6):        V9 

      Physical Name(6): /wrds/pacap/sasdata/sn

      Engine(7):        V9 

      Physical Name(7): /wrds/pacap/sasdata/tw

      Engine(8):        V9 

      Physical Name(8): /wrds/pacap/sasdata/th

NOTE: Libref PHLX was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/phlx/sasdata

NOTE: Libref PITCHBK was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/pitchbk/sasdata/other_northam

      Engine(2):        V9 

      Physical Name(2): /wrds/pitchbk/sasdata/other_glb

      Engine(3):        V9 

      Physical Name(3): /wrds/pitchbk/sasdata/pe_northam

      Engine(4):        V9 

      Physical Name(4): /wrds/pitchbk/sasdata/pe_glb

      Engine(5):        V9 

      Physical Name(5): /wrds/pitchbk/sasdata/vc_northam

      Engine(6):        V9 

      Physical Name(6): /wrds/pitchbk/sasdata/vc_glb

      Engine(7):        V9 

      Physical Name(7): /wrds/pitchbk/sasdata/common

NOTE: Libref PITCHSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/pitchbk

NOTE: Libref PREQIN was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/preqin/sasdata/lp

      Engine(2):        V9 

      Physical Name(2): /wrds/preqin/sasdata/gp

      Engine(3):        V9 

      Physical Name(3): /wrds/preqin/sasdata/company_deals

      Engine(4):        V9 

      Physical Name(4): /wrds/preqin/sasdata/cashflow

NOTE: Libref PREQINLG was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/preqin/sasdata/private_equity

      Engine(2):        V9 

      Physical Name(2): /wrds/preqin/sasdata/venture_capital

NOTE: Libref PREQSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/preqin

NOTE: Libref PUBLIC was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/public/sasdata/climate/noaa

      Engine(2):        V9 

      Physical Name(2): /wrds/public/sasdata/legal/govtrack

      Engine(3):        V9 

      Physical Name(3): /wrds/public/sasdata/macroecon/bea

      Engine(4):        V9 

      Physical Name(4): /wrds/public/sasdata/macroecon/bls

      Engine(5):        V9 

      Physical Name(5): /wrds/public/sasdata/healthcare/hcup

      Engine(6):        V9 

      Physical Name(6): /wrds/public/sasdata/healthcare/meps

      Engine(7):        V9 

      Physical Name(7): /wrds/public/sasdata/taxis

NOTE: Libref PWT was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/pwt/sasdata

NOTE: Libref REPRISK was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/reprisk/sasdata/pm

      Engine(2):        V9 

      Physical Name(2): /wrds/reprisk/sasdata/std

      Engine(3):        V9 

      Physical Name(3): /wrds/reprisk/sasdata/v2

      Engine(4):        V9 

      Physical Name(4): /wrds/reprisk/sasdata

NOTE: Libref REPSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/reprisk

NOTE: Libref REVELIO was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/revelio/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/revelio/sasdata/common

      Engine(3):        V9 

      Physical Name(3): /wrds/revelio/sasdata/individual

      Engine(4):        V9 

      Physical Name(4): /wrds/revelio/sasdata/sentiment

      Engine(5):        V9 

      Physical Name(5): /wrds/revelio/sasdata/job_postings

      Engine(6):        V9 

      Physical Name(6): /wrds/revelio/sasdata/workforce_dynamics

      Engine(7):        V9 

      Physical Name(7): /wrds/revelio/sasdata/layoffs

NOTE: Libref REVSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/revelio

NOTE: Libref REVERE was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/factset/sasdata/revere_common

      Engine(2):        V9 

      Physical Name(2): /wrds/factset/sasdata/revere_supply_chain

      Engine(3):        V9 

      Physical Name(3): /wrds/factset/sasdata/revere_geo_rev

      Engine(4):        V9 

      Physical Name(4): /wrds/factset/sasdata/revere_ind_class

WARNING: One or more libraries specified in the concatenated library RISK do 

         not exist.  These libraries were removed from the concatenation.

NOTE: Libref RISK was successfully assigned as follows: 

      Levels:           11

      Engine(1):        V9 

      Physical Name(1): /wrds/riskmetrics/sasdata/directors

      Engine(2):        V9 

      Physical Name(2): /wrds/riskmetrics/sasdata/governance

      Engine(3):        V9 

      Physical Name(3): /wrds/riskmetrics/sasdata/proposals

      Engine(4):        V9 

      Physical Name(4): /wrds/riskmetrics/sasdata/incentive_lab

      Engine(5):        V9 

      Physical Name(5): /wrds/riskmetrics/sasdata/incentive_lab/europe

      Engine(6):        V9 

      Physical Name(6): /wrds/riskmetrics/sasdata/votes

      Engine(7):        V9 

      Physical Name(7): /wrds/riskmetrics/sasdata/voting_analytics

      Engine(8):        V9 

      Physical Name(8): /wrds/riskmetrics/sasdata/voting_analytics/mf

      Engine(9):        V9 

      Physical Name(9): /wrds/riskmetrics/sasdata/voting_analytics/proposals

      Engine(10):        V9 

      Physical Name(10): 

      /wrds/riskmetrics/sasdata/voting_analytics/voteresults_global

      Engine(11):        V9 

      Physical Name(11): 

      /wrds/riskmetrics/sasdata/voting_analytics/voteresults_us

NOTE: Libref RISKSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/riskmetrics

NOTE: Libref RPA was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/ravenpack/sasdata/rpa_1_0

      Engine(2):        V9 

      Physical Name(2): /wrds/ravenpack/sasdata/rpa_1_0_dj_pr_edition

      Engine(3):        V9 

      Physical Name(3): /wrds/ravenpack/sasdata/rpa_1_0_web_edition

      Engine(4):        V9 

      Physical Name(4): /wrds/ravenpack/sasdata/rpa_1_0_common

NOTE: Libref RPNA was successfully assigned as follows: 

      Levels:           5

      Engine(1):        V9 

      Physical Name(1): /wrds/ravenpack/sasdata/common

      Engine(2):        V9 

      Physical Name(2): /wrds/ravenpack/sasdata/dow_jones_edition

      Engine(3):        V9 

      Physical Name(3): /wrds/ravenpack/sasdata/full_edition

      Engine(4):        V9 

      Physical Name(4): /wrds/ravenpack/sasdata/pr_edition

      Engine(5):        V9 

      Physical Name(5): /wrds/ravenpack/sasdata/web_edition

NOTE: Libref RPNASAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/ravenpack

NOTE: Libref RSTAT was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/royaltystat/sasdata

NOTE: Libref SDC was successfully assigned as follows: 

      Levels:           5

      Engine(1):        V9 

      Physical Name(1): /wrds/tfn/sasdata/sdc_joint_ventures

      Engine(2):        V9 

      Physical Name(2): /wrds/tfn/sasdata/sdc_ma

      Engine(3):        V9 

      Physical Name(3): /wrds/tfn/sasdata/sdc_municipals

      Engine(4):        V9 

      Physical Name(4): /wrds/tfn/sasdata/sdc_ni

      Engine(5):        V9 

      Physical Name(5): /wrds/tfn/sasdata/sdc_private_equity

NOTE: Libref SDCSAMP was successfully assigned as follows: 

      Levels:           5

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/tfn/sdc_joint_ventures

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/tfn/sdc_ma

      Engine(3):        V9 

      Physical Name(3): /wrds/samples/sasdata/tfn/sdc_municipals

      Engine(4):        V9 

      Physical Name(4): /wrds/samples/sasdata/tfn/sdc_ni

      Engine(5):        V9 

      Physical Name(5): /wrds/samples/sasdata/tfn/sdc_pe

NOTE: Libref SDS was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/sds/sasdata

NOTE: Libref SECSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/sec

NOTE: Libref SHORTVOL was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/short_volume/sasdata

NOTE: Libref SHVLSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/short_volume

NOTE: Libref SNAPSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/comp_snap

NOTE: Libref SPRAT was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/comp/sasdata/sprat

NOTE: Libref SUSTAIN was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/sustain/sasdata

NOTE: Libref SUSTSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/sustain

NOTE: Libref TAQ was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/taq/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/nyse/sasdata/wrds_taqs_ct

      Engine(3):        V9 

      Physical Name(3): /wrds/nyse/sasdata/wrds_taqs_nbbo

      Engine(4):        V9 

      Physical Name(4): /wrds/nyse/sasdata/wrds_taqs_iid_v1

NOTE: Libref TAQMSEC was successfully assigned as follows: 

      Levels:           10

      Engine(1):        V9 

      Physical Name(1): /wrds/nyse/sasdata/taqms/ct

      Engine(2):        V9 

      Physical Name(2): /wrds/nyse/sasdata/taqms/cq

      Engine(3):        V9 

      Physical Name(3): /wrds/nyse/sasdata/taqms/luld_cq

      Engine(4):        V9 

      Physical Name(4): /wrds/nyse/sasdata/taqms/luld_ct

      Engine(5):        V9 

      Physical Name(5): /wrds/nyse/sasdata/taqms/mast

      Engine(6):        V9 

      Physical Name(6): /wrds/nyse/sasdata/taqms/nbbo

      Engine(7):        V9 

      Physical Name(7): /wrds/nyse/sasdata/taqms/nbbod2m

      Engine(8):        V9 

      Physical Name(8): /wrds/nyse/sasdata/wrds_taqms_nbbo

      Engine(9):        V9 

      Physical Name(9): /wrds/nyse/sasdata/wrds_taqms_wct

      Engine(10):        V9 

      Physical Name(10): /wrds/nyse/sasdata/wrds_taqms_iid

NOTE: Libref TAQSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/taqsamp/sasdata

NOTE: Libref TAQMSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/taqmssamp/sasdata

NOTE: Libref TASS was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/tfn/sasdata/tass

NOTE: Libref TR_DS was successfully assigned as follows: 

      Levels:           8

      Engine(1):        V9 

      Physical Name(1): /wrds/tfn/sasdata/ds_eq/pricing

      Engine(2):        V9 

      Physical Name(2): /wrds/tfn/sasdata/ds_eq/index

      Engine(3):        V9 

      Physical Name(3): /wrds/tfn/sasdata/ds_eq/corporate_action

      Engine(4):        V9 

      Physical Name(4): /wrds/tfn/sasdata/ds_eq/index_constituents

      Engine(5):        V9 

      Physical Name(5): /wrds/tfn/sasdata/ds_eq/reference_tables

      Engine(6):        V9 

      Physical Name(6): /wrds/tfn/sasdata/ds_com

      Engine(7):        V9 

      Physical Name(7): /wrds/tfn/sasdata/ds_econ

      Engine(8):        V9 

      Physical Name(8): /wrds/tfn/sasdata/ds_fut

NOTE: Libref TRCOMMON was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/tfn/sasdata/common

NOTE: Libref TRDMISMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/tfn/db_dmi

NOTE: Libref TRDSSAMP was successfully assigned as follows: 

      Levels:           4

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/tfn/trds/ds_eq

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/tfn/trds/ds_fut

      Engine(3):        V9 

      Physical Name(3): /wrds/samples/sasdata/tfn/trds/ds_econ

      Engine(4):        V9 

      Physical Name(4): /wrds/samples/sasdata/tfn/trds/ds_com

NOTE: Libref TRESG was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/tfn/sasdata/esg

NOTE: Libref TRESGSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/tfn/tresg

NOTE: Libref TRWBSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/tfn/db_wb

NOTE: Libref TFN was successfully assigned as follows: 

      Levels:           11

      Engine(1):        V9 

      Physical Name(1): /wrds/tfn/sasdata/s12

      Engine(2):        V9 

      Physical Name(2): /wrds/tfn/sasdata/s34

      Engine(3):        V9 

      Physical Name(3): /wrds/tfn/sasdata/insiders

      Engine(4):        V9 

      Physical Name(4): /wrds/tfn/sasdata/ds_eq/pricing

      Engine(5):        V9 

      Physical Name(5): /wrds/tfn/sasdata/ds_eq/index

      Engine(6):        V9 

      Physical Name(6): /wrds/tfn/sasdata/ds_eq/corporate_action

      Engine(7):        V9 

      Physical Name(7): /wrds/tfn/sasdata/ds_eq/index_constituents

      Engine(8):        V9 

      Physical Name(8): /wrds/tfn/sasdata/ds_eq/reference_tables

      Engine(9):        V9 

      Physical Name(9): /wrds/tfn/sasdata/ds_com

      Engine(10):        V9 

      Physical Name(10): /wrds/tfn/sasdata/ds_econ

      Engine(11):        V9 

      Physical Name(11): /wrds/tfn/sasdata/ds_fut

NOTE: Libref TRSAMP was successfully assigned as follows: 

      Levels:           3

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/ibes_guidance

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/tass

      Engine(3):        V9 

      Physical Name(3): /wrds/samples/sasdata/worldscope

NOTE: Libref TOTALQ refers to the same physical library as CONTRIB.

NOTE: Libref TOTALQ was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/contributors/sasdata/total_q

NOTE: Libref TRACE was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/trace/sasdata/standard

      Engine(2):        V9 

      Physical Name(2): /wrds/trace/sasdata/enhanced

NOTE: Libref TRCSTSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/trucost

NOTE: Libref TROWN was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/tfn/sasdata/ownership

NOTE: Libref TRUCOST was successfully assigned as follows: 

      Levels:           12

      Engine(1):        V9 

      Physical Name(1): /wrds/trucost/sasdata/carbon_data

      Engine(2):        V9 

      Physical Name(2): /wrds/trucost/sasdata/carbon_forecast

      Engine(3):        V9 

      Physical Name(3): /wrds/trucost/sasdata/common

      Engine(4):        V9 

      Physical Name(4): /wrds/trucost/sasdata/environment

      Engine(5):        V9 

      Physical Name(5): /wrds/trucost/sasdata/esg

      Engine(6):        V9 

      Physical Name(6): /wrds/trucost/sasdata/ff_data

      Engine(7):        V9 

      Physical Name(7): /wrds/trucost/sasdata/ff_sector

      Engine(8):        V9 

      Physical Name(8): /wrds/trucost/sasdata/paris_data

      Engine(9):        V9 

      Physical Name(9): /wrds/trucost/sasdata/paris_emissions

      Engine(10):        V9 

      Physical Name(10): /wrds/trucost/sasdata/revenue

      Engine(11):        V9 

      Physical Name(11): /wrds/trucost/sasdata/risk_data

      Engine(12):        V9 

      Physical Name(12): /wrds/trucost/sasdata/risk_forecast

NOTE: Libref TRWS was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/tfn/sasdata/worldscope

NOTE: Libref TWOIQ was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/2iq/sasdata

NOTE: Libref TWOIQSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/2iq

NOTE: Libref WAPPSAMP was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/ciqevtstudy

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/ciqintevtstudy

NOTE: Libref WENVSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/environmental

NOTE: Libref WIND was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/wind/sasdata/china_a_share

      Engine(2):        V9 

      Physical Name(2): /wrds/wind/sasdata/wind_basic_code

NOTE: Libref WINDSMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/wind

NOTE: Libref WMFSMP was successfully assigned as follows: 

      Levels:           2

      Engine(1):        V9 

      Physical Name(1): /wrds/samples/sasdata/mutualfund/ncen

      Engine(2):        V9 

      Physical Name(2): /wrds/samples/sasdata/mutualfund/nsar

NOTE: Libref WQA was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/wqa/sasdata

NOTE: Libref WRDSENV was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/environmental/sasdata

NOTE: Libref WRDSINSD was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/insiders/sasdata

NOTE: Libref WRDSMF was successfully assigned as follows: 

      Levels:           3

      Engine(1):        V9 

      Physical Name(1): /wrds/mutualfund/sasdata/nsar/processed

      Engine(2):        V9 

      Physical Name(2): /wrds/mutualfund/sasdata/nsar/raw

      Engine(3):        V9 

      Physical Name(3): /wrds/mutualfund/sasdata/ncen

NOTE: Libref WRDSSEC was successfully assigned as follows: 

      Levels:           7

      Engine(1):        V9 

      Physical Name(1): /wrds/sec/sasdata

      Engine(2):        V9 

      Physical Name(2): /wrds/sec/sasdata/bow

      Engine(3):        V9 

      Physical Name(3): /wrds/sec/sasdata/common

      Engine(4):        V9 

      Physical Name(4): /wrds/sec/sasdata/premium/itemized

      Engine(5):        V9 

      Physical Name(5): /wrds/sec/sasdata/sa

      Engine(6):        V9 

      Physical Name(6): /wrds/sec/sasdata/topics

      Engine(7):        V9 

      Physical Name(7): /wrds/sec/sasdata/VentureCapital

NOTE: Libref WRDSAPPS was successfully assigned as follows: 

      Levels:           36

      Engine(1):        V9 

      Physical Name(1): /wrds/wrdsapps/sasdata/backtester/basic

      Engine(2):        V9 

      Physical Name(2): /wrds/wrdsapps/sasdata/backtester/plus

      Engine(3):        V9 

      Physical Name(3): /wrds/wrdsapps/sasdata/bond

      Engine(4):        V9 

      Physical Name(4): /wrds/wrdsapps/sasdata/ciqintevtstudy

      Engine(5):        V9 

      Physical Name(5): /wrds/wrdsapps/sasdata/cwsubsidiary

      Engine(6):        V9 

      Physical Name(6): /wrds/wrdsapps/sasdata/eushortselling

      Engine(7):        V9 

      Physical Name(7): /wrds/wrdsapps/sasdata/finratio/fr

      Engine(8):        V9 

      Physical Name(8): /wrds/wrdsapps/sasdata/finratio/fr_ccm

      Engine(9):        V9 

      Physical Name(9): /wrds/wrdsapps/sasdata/finratio/fr_ibes

      Engine(10):        V9 

      Physical Name(10): /wrds/wrdsapps/sasdata/finratio/fr_ibes_ccm

      Engine(11):        V9 

      Physical Name(11): /wrds/wrdsapps/sasdata/gindices

      Engine(12):        V9 

      Physical Name(12): /wrds/wrdsapps/sasdata/intevtstudy

      Engine(13):        V9 

      Physical Name(13): /wrds/wrdsapps/sasdata/linking/bclink

      Engine(14):        V9 

      Physical Name(14): /wrds/wrdsapps/sasdata/linking/bdxcrspcomplink

      Engine(15):        V9 

      Physical Name(15): /wrds/wrdsapps/sasdata/linking/bdxinslink

      Engine(16):        V9 

      Physical Name(16): /wrds/wrdsapps/sasdata/linking/dswslink

      Engine(17):        V9 

      Physical Name(17): /wrds/wrdsapps/sasdata/linking/fscrsplink

      Engine(18):        V9 

      Physical Name(18): /wrds/wrdsapps/sasdata/linking/iclink

      Engine(19):        V9 

      Physical Name(19): /wrds/wrdsapps/sasdata/linking/oclink

      Engine(20):        V9 

      Physical Name(20): 

      /wrds/wrdsapps/sasdata/linking/peoplelnk/boardex_ciq_link

      Engine(21):        V9 

      Physical Name(21): 

      /wrds/wrdsapps/sasdata/linking/peoplelnk/boardex_trinsider_link

      Engine(22):        V9 

      Physical Name(22): 

      /wrds/wrdsapps/sasdata/linking/peoplelnk/boardex_twoiq_link

      Engine(23):        V9 

      Physical Name(23): 

      /wrds/wrdsapps/sasdata/linking/peoplelnk/exec_boardex_link

      Engine(24):        V9 

      Physical Name(24): /wrds/wrdsapps/sasdata/linking/peoplelnk/exec_ciq_link

      Engine(25):        V9 

      Physical Name(25): 

      /wrds/wrdsapps/sasdata/linking/peoplelnk/exec_trinsider_link

      Engine(26):        V9 

      Physical Name(26): 

      /wrds/wrdsapps/sasdata/linking/peoplelnk/exec_twoiq_link

      Engine(27):        V9 

      Physical Name(27): 

      /wrds/wrdsapps/sasdata/linking/peoplelnk/trinsider_ciq_link

      Engine(28):        V9 

      Physical Name(28): 

      /wrds/wrdsapps/sasdata/linking/peoplelnk/trinsider_twoiq_link

      Engine(29):        V9 

      Physical Name(29): /wrds/wrdsapps/sasdata/linking/peoplelnk/twoiq_ciq_link

      Engine(30):        V9 

      Physical Name(30): /wrds/wrdsapps/sasdata/linking/seglink

      Engine(31):        V9 

      Physical Name(31): /wrds/wrdsapps/sasdata/linking/taqmclink

      Engine(32):        V9 

      Physical Name(32): /wrds/wrdsapps/sasdata/linking/tclink

      Engine(33):        V9 

      Physical Name(33): /wrds/wrdsapps/sasdata/linking/wsds2link

      Engine(34):        V9 

      Physical Name(34): /wrds/wrdsapps/sasdata/longrunevt

      Engine(35):        V9 

      Physical Name(35): /wrds/wrdsapps/sasdata/ravtaqevtstudy

      Engine(36):        V9 

      Physical Name(36): /wrds/wrdsapps/sasdata/wpatent

NOTE: Libref ZACKS was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/zacks/sasdata

NOTE: Libref ZACKSAMP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/samples/sasdata/zacks



NOTE: AUTOEXEC processing completed.



NOTE: Remote signon to WRDS complete.

38   rsubmit;

NOTE: Remote submit to WRDS commencing.

1     libname crsp '/wrds/crsp/sasdata/a_stock';

NOTE: Libref CRSP refers to the same physical library as CRSPA.

NOTE: Libref CRSP was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: /wrds/crsp/sasdata/a_stock

1   !                                           run;

2     

3     proc upload data=rep out=rep2;run;





NOTE: Upload in progress from data=WORK.REP to out=WORK.REP2

NOTE: 309360 bytes were transferred at 1362819 bytes/second.

NOTE: The data set WORK.REP has 2578 observations and 15 variables.

NOTE: Uploaded 2578 observations of 15 variables.

NOTE: The data set WORK.REP2 has 2578 observations and 15 variables.

NOTE: PROCEDURE UPLOAD used (Total process time):

      real time           0.43 seconds

      cpu time            0.02 seconds

      



4     

5     

6     %MACRO EVTSTUDY_NEW (INSET=, OUTSET=, OUTSTATS=, ID=, EVTDATE=,

7     

8                          ESTPER=, START=, END=, GAP=, GROUP=, MODEL=);

9     

10    

11       %local evtwin factors abret newvars;

12       %local oldoptions errors;

13       %let oldoptions=%sysfunc(getoption(mprint)) %sysfunc(getoption(notes))

14                       %sysfunc(getoption(source));

15       %let errors=%sysfunc(getoption(errors));

16       options notes mprint source errors=0;  /* display all for debug. CHANGE

16  !  HERE */

17    

18      %let evtwin=%eval(&end-&start+1); *length of event window in trading

18  ! days;

19    

20      /*depending on the model, define the model for abnormal returns*/

21      %if %lowcase(&model)=madj %then %do; %let factors=vwretd;

22                  %let abret=ret-vwretd;

23                  %let newvars=(intercept=alpha);

24                  %end;%else

25      %if %lowcase(&model)=m %then  %do; %let factors=vwretd;

26                  %let abret=ret-alpha-beta*vwretd;

27                  %let newvars=(intercept=alpha vwretd=beta);

28                  %end;%else

29      %if %lowcase(&model)=ff %then %do;

30                  %let factors=vwretd smb hml;

31                  %let abret=ret-alpha-beta*vwretd-sminb*smb-hminl*hml;

32                  %let newvars=(intercept=alpha vwretd=beta smb=sminb

32  ! hml=hminl);

33                  %end;%else

34      %if %lowcase(&model)=ffm %then %do;

35                  %let factors=vwretd smb hml mom;

36                  %let

36  ! abret=ret-alpha-beta*vwretd-sminb*smb-hminl*hml-wminl*mom;

37                  %let newvars=(intercept=alpha vwretd=beta smb=sminb

37  ! hml=hminl mom=wminl);

38                  %end;

39    

40      %put; %put ### CREATING TRADING DAY CALENDAR...;

41      data _caldates;

42       merge crsp.dsi (keep=date rename=(date=estper_beg))

43       crsp.dsi (keep=date firstobs=%eval(&estper) rename=(date=estper_end))

44       crsp.dsi (keep=date firstobs=%eval(&estper+&gap+1)

44  ! rename=(date=evtwin_beg))

45       crsp.dsi (keep=date firstobs=%eval(&estper+&gap-&start+1)

45  ! rename=(date=&evtdate))

46       crsp.dsi (keep=date firstobs=%eval(&estper+&gap+&evtwin)

46  ! rename=(date=evtwin_end));

47       format estper_beg estper_end evtwin_beg &evtdate evtwin_end date9.;

48       if nmiss(estper_beg,estper_end,evtwin_beg,evtwin_end,&evtdate)=0;

49       time+1;

50      run;

51     %put ### DONE!;

52    

53      /*If primary identifier is Cusip, then link in permno*/

54      %if %lowcase(&id)=cusip %then %do;

55      proc sql;

56       create view  _link

57       as select permno, ncusip,

58       min(namedt) as fdate format=date9., max(nameendt) as ldate

58  ! format=date9.

59       from crsp.dsenames

60       group by permno, ncusip;

61    

62       create table _temp

63       as select distinct b.permno, a.*

64       from &inset a left join _link b

65       on a.cusip=b.ncusip and b.fdate<=a.&evtdate<=b.ldate

66       order by b.permno, a.&evtdate;  /* error correction. CHANGE HERE */

67      quit;%end;

68      %else %do;

69      /*pre-sort the input dataset in case it is not sorted yet*/

70      proc sort data=&inset out=_temp;

71       by permno &evtdate;  /* error correction. CHANGE HERE */

72      run;

73      %end;

74    

75      /*If event date is a non-trading day, select the closest */

76      /*trading day that  follows the event day                */

77      /*Merge in relevant dates from the trading calendar      */

78    

79      /* CHANGE HERE TO IMPROVE EFFICIENCY

80      proc sql;

81       create table _temp (drop=&evtdate)

82       as select a.*, a.&evtdate as _edate format date9., b.*

83       from _temp a left join _caldates (drop=time) b

84       on b.&evtdate-a.&evtdate>=0

85      group by a.&evtdate

86      having (b.&evtdate-a.&evtdate)=min(b.&evtdate-a.&evtdate);

87      quit; */

88    

89      proc sql;

90       create table _caldates1

91       as select

91  ! a.&evtdate,b.estper_beg,b.estper_end,b.evtwin_beg,b.evtwin_end,b.time

92       from (select distinct &evtdate from _temp) a left join _caldates b

93       on b.&evtdate-a.&evtdate>=0

94      group by a.&evtdate

95      having (b.&evtdate-a.&evtdate)=min(b.&evtdate-a.&evtdate);

96    

97       create table _temp1 (drop=&evtdate)  /* use _temp1 to surpress warnings

98                                 and reserve _temp for later use. CHANGE HERE

98  ! */

99       as select a.*, a.&evtdate as _edate format date9., b.*

100      from _temp a left join _caldates1 (drop=time) b

101      on b.&evtdate=a.&evtdate;

102     quit;

103   

104     %put ; %put ### PREPARING BENCHMARK FACTORS... ;

105     proc sql;create table _factors

106      as select a.date, a.vwretd, b.smb, b.hml, b.umd as mom

107      from crsp.dsi (keep=date vwretd) a left join ff.factors_daily b

108      on a.date=b.date;

109     quit;

110     %put ### DONE! ;

111   

112     %put; %put ### RETRIEVING RETURNS DATA FROM CRSP...;

113     proc sql;

114      create table _evtrets_temp

115       as select a.permno, a.date format date9., a.ret as ret1, b.*

116      from crsp.dsf a, _temp1 b  /* follow the previous correction. CHANGE

116 ! HERE */

117       where a.permno=b.permno and b.estper_beg<=a.date<=b.evtwin_end;

118     quit;

119     %put ### DONE!;

120   

121     %put; %put ### MERGING IN BECHMARK FACTORS...;

122     proc sql;

123      create table _evtrets1

124        as select a.*, b.*, (c.time-d.time) as evttime

125      from _evtrets_temp a

126      left join _factors (keep=date &factors) b

127           on a.date=b.date

128      left join _caldates c

129           on a.date=c.&evtdate

130      left join _caldates d

131           on a._edate=d.&evtdate;

132   

133      create table _evtrets (where=(not missing(vwretd)))

134        as select a.*, a.ret1 label='Ret unadjusted for delisting',

135        (1+a.ret1)*sum(1,b.dlret)-1-a.vwretd as exret label='Market-adjusted

135 ! total ret',

136        (1+a.ret1)*sum(1,b.dlret)-1 as ret "Ret adjusted for delisting"

137      from _evtrets1 a left join crsp.dsedelist (where=(missing(dlret)=0)) b

138      on a.permno=b.permno and a.date=b.dlstdt

139      order by a.permno,a._edate,a.date, a.evttime;

140    quit;

141    %put ### DONE!;

142   

143    %put; %put ### ESTIMATING FACTOR EXPOSURES OVER THE ESTIMATION PERIOD...;

144    %if %lowcase(&model) ne madj %then %do;

145     /*estimate risk factor exposures during the estimation period*/

146     proc reg data=_evtrets edf outest=_params (rename=&newvars

147       keep=permno _edate intercept &factors _rmse_  _p_ _edf_) noprint;

148       where estper_beg<=date<=estper_end;

149       by permno _edate;

150       model ret=&factors;

151     quit;%end;

152     %else %do;

153      proc reg data=_evtrets edf outest=_params (rename=&newvars

154       keep=permno _edate intercept _rmse_  _p_ _edf_) noprint;

155       where estper_beg<=date<=estper_end;

156       by permno _edate;

157       model ret=;

158     quit;%end;

159    %put ### DONE!;

160   

161    %put; %put ### CALCULATING ONE-DAY ABNORMAL RETURN IN THE EVENT WINDOW...

161 ! ;

162     data _abrets/view=_abrets;

163       merge _evtrets (where=(evtwin_beg<=date<=evtwin_end) in=a) _params;

164        by permno _edate;

165        abret=&abret;

166        logret=log(1+ret);

167        var_estp=_rmse_*_rmse_;

168        nobs=_p_+_edf_;

169        label var_estp='Estimation Period Variance'

170              abret=   'One-day Abnormal Return (AR)'

171              ret=     'Raw Return'

172              _edate= 'Event Date'

173              evttime= "Trading day within (&start,&end) event window";

174        drop _p_ _edf_ estper_beg estper_end;

175        if a;

176     run;

177    %put ### DONE!;

178   

179    %put; %put ### CALCULATING CARS AND VARIOUS STATISTICS...;

180     proc means data=_abrets noprint;

181      by permno _edate;

182      id &group var_estp;

183     output out=_car sum(logret)=cret sum(abret)=car n(abret)=nrets;

184   

185     /*calculate Standardized Cumulative Abnormal Returns*/

186     data _car; set _car;

187       poscar=car>0;

188       scar=car/(&evtwin*var_estp)**0.5;

189       cret=exp(cret)-1;

190       label poscar='Positive Abnormal Return Dummy'

191             scar=  'Standardized Cumulative Abnormal Return (SCAR)'

192             car=   'Cumulative Abnormal Return (CAR)'

193             cret=  'Cumulative Raw Return'

194            nrets=  'Number of non-missing abnormal returns within event

194 ! window';

195   

196     /*compute stats across all events (i.e., permno-event date

196 ! combinations*/

197     proc means data=_car noprint;

198       var cret car scar poscar;

199       class &group;

200       output out=_test

201     mean= n= t=/autoname;

202   

203     /*calculate different stats for assessing    */

204     /*statistical signficance of abnormal returns*/

205     data &outstats; set _test;

206       tpatell=scar_mean*((scar_n)**0.5);

207       tsign=(poscar_mean-0.5)/sqrt(0.25/poscar_n);

208       format cret_mean car_mean percent7.5;

209       label tpatell=     "Patell's t-stat"

210        car_mean=    'Mean Cumulative Abnormal Return'

211        cret_mean=   'Mean Cumulative Raw Return'

212        scar_mean=   'Mean Cumulative Standardized Abnormal Return'

213        car_t=       'Cross-sectional t-stat'

214        scar_t=      "Boehmer's et al. (1991) t-stat"

215        car_n=       'Number of events in the portfolio'

216        poscar_mean= 'Percent of positive abnormal returns'

217        tsign=       'Sign-test statistic';

218       drop cret_N scar_N poscar_N cret_t poscar_t;

219      run;

220     %put ### DONE!;

221   

222     proc print label u;

223       title1 "Output for dataset &inset for a

224      (&start,&end) event window using &model model";

225       id &group;

226       var cret_mean car_mean scar_mean poscar_mean

227            car_n tsign tpatell car_t scar_t;

228   

229    %if "&group" ne "" %then %do;

230     title2 "Test for Equality of CARs among groups defined by &group";

231   

232    /*To find out the results of the hypothesis test for comparing groups

232 ! */

233    /*find the row of output labeled 'Model' and look at the column labeled

233 ! */

234    /*F-value for the Fisher statistic and Pr>F for the associated p-value

234 ! */

235    /*HOVTEST tests for whether variances of two groups are the same

235 ! */

236    proc glm data=_car;

237      class &group;

238      model scar=&group;

239      means &group /hovtest;

240   

241    proc npar1way data=_car wilcoxon;

242     var scar;

243     class &group;

244    %end;

245    run;

246   

247   /*create the final output dataset*/

248     %if %lowcase(&model) ne madj %then %do;

249                 %let _beta=_params(keep=permno _edate beta);

250                 %let _beta_label=beta='Beta';

251                 %end;

252     %else %do;

253                 %let _beta=;

254                 %let _beta_label=;

255                 %end;  /* add IF statement. CHANGE HERE */

256   

257   data &outset;

258      merge _temp (in=a rename=(&evtdate=_edate))  /* error correction.

258 ! CHANGE HERE */

259            _abrets(keep=permno _edate date evttime ret abret var_estp)

260            _car   (keep=permno _edate cret car scar nrets)

261            &_beta;  /* add &_beta. CHANGE HERE */

262      by permno _edate;

263      rename _edate=&evtdate;  /* error correction. CHANGE HERE */

264      label _edate='Event date'

265            date='Trading date in event window'

266            &_beta_label;  /* add &_beta_label. CHANGE HERE */

267      format _edate date9. date date9.;

268      if a;

269     run;

270   

271    /*house cleaning*/

272    proc sql; drop table _caldates, _car, _factors, _test,

273            _params, _temp, _evtrets,_evtrets1, _evtrets_temp,

274            _caldates1, _temp1;

275             drop view _abrets; quit;

276    options errors=&errors &oldoptions;

277    %put ;%put ### OUTPUT IN THE DATASET &outset;

278    %put ;%put ### TEST STATISTICS IN THE DATASET &outstats;

279   %MEND;

280   

281   

282   

283   %EVTSTUDY_NEW (INSET=rep2, OUTSET=car1, OUTSTATS=car_t, ID=permno,

284   EVTDATE=news_date, ESTPER=110, START=-1, END=1, GAP=10, GROUP=, MODEL=ffm)

284 ! ;

MPRINT(EVTSTUDY_NEW):   errors=0;

MPRINT(EVTSTUDY_NEW):   *length of event window in trading days;



### CREATING TRADING DAY CALENDAR...

MPRINT(EVTSTUDY_NEW):   data _caldates;

MPRINT(EVTSTUDY_NEW):   merge crsp.dsi (keep=date rename=(date=estper_beg)) 

crsp.dsi (keep=date firstobs=110 rename=(date=estper_end)) crsp.dsi (keep=date 

firstobs=121 rename=(date=evtwin_beg)) crsp.dsi (keep=date firstobs=122 

rename=(date=news_date)) crsp.dsi (keep=date firstobs=123 

rename=(date=evtwin_end));

MPRINT(EVTSTUDY_NEW):   format estper_beg estper_end evtwin_beg news_date 

evtwin_end date9.;

MPRINT(EVTSTUDY_NEW):   if 

nmiss(estper_beg,estper_end,evtwin_beg,evtwin_end,news_date)=0;

MPRINT(EVTSTUDY_NEW):   time+1;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 26051 observations read from the data set CRSP.DSI.

NOTE: There were 25942 observations read from the data set CRSP.DSI.

NOTE: There were 25931 observations read from the data set CRSP.DSI.

NOTE: There were 25930 observations read from the data set CRSP.DSI.

NOTE: There were 25929 observations read from the data set CRSP.DSI.

NOTE: The data set WORK._CALDATES has 25929 observations and 6 variables.

NOTE: DATA statement used (Total process time):

      real time           0.07 seconds

      cpu time            0.05 seconds

      



### DONE!

MPRINT(EVTSTUDY_NEW):   proc sort data=rep2 out=_temp;

MPRINT(EVTSTUDY_NEW):   by permno news_date;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 2578 observations read from the data set WORK.REP2.

NOTE: The data set WORK._TEMP has 2578 observations and 15 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _caldates1 as select 

a.news_date,b.estper_beg,b.estper_end,b.evtwin_beg,b.evtwin_end,b.time from 

(select distinct news_date from _temp) a left join _caldates b on 

b.news_date-a.news_date>=0 group by a.news_date having 

(b.news_date-a.news_date)=min(b.news_date-a.news_date);

NOTE: The execution of this query involves performing one or more Cartesian 

      product joins that can not be optimized.

NOTE: The query requires remerging summary statistics back with the original 

      data.

NOTE: Table WORK._CALDATES1 created, with 813 rows and 6 columns.



MPRINT(EVTSTUDY_NEW):   create table _temp1 (drop=news_date) as select a.*, 

a.news_date as _edate format date9., b.* from _temp a left join _caldates1 

(drop=time) b on b.news_date=a.news_date;

NOTE: Table WORK._TEMP1 created, with 2578 rows and 19 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1.74 seconds

      cpu time            2.46 seconds

      





### PREPARING BENCHMARK FACTORS...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):  create table _factors as select a.date, a.vwretd, b.smb, 

b.hml, b.umd as mom from crsp.dsi (keep=date vwretd) a left join 

ff.factors_daily b on a.date=b.date;

NOTE: Table WORK._FACTORS created, with 26051 rows and 5 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.04 seconds

      cpu time            0.04 seconds

      



### DONE!



### RETRIEVING RETURNS DATA FROM CRSP...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _evtrets_temp as select a.permno, a.date 

format date9., a.ret as ret1, b.* from crsp.dsf a, _temp1 b where 

a.permno=b.permno and b.estper_beg<=a.date<=b.evtwin_end;

WARNING: Variable permno already exists on file WORK._EVTRETS_TEMP.

NOTE: Table WORK._EVTRETS_TEMP created, with 316721 rows and 21 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           12.86 seconds

      cpu time            11.76 seconds

      



### DONE!



### MERGING IN BECHMARK FACTORS...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _evtrets1 as select a.*, b.*, 

(c.time-d.time) as evttime from _evtrets_temp a left join _factors (keep=date 

vwretd smb hml mom) b on a.date=b.date left join _caldates c on 

a.date=c.news_date left join _caldates d on a._edate=d.news_date;

WARNING: Variable DATE already exists on file WORK._EVTRETS1.

NOTE: Table WORK._EVTRETS1 created, with 316721 rows and 26 columns.



MPRINT(EVTSTUDY_NEW):   create table _evtrets (where=(not missing(vwretd))) as 

select a.*, a.ret1 label='Ret unadjusted for delisting', 

(1+a.ret1)*sum(1,b.dlret)-1-a.vwretd as exret label='Market-adjusted total 

ret', (1+a.ret1)*sum(1,b.dlret)-1 as ret "Ret adjusted for delisting" from 

_evtrets1 a left join crsp.dsedelist (where=(missing(dlret)=0)) b on 

a.permno=b.permno and a.date=b.dlstdt order by a.permno,a._edate,a.date, 

a.evttime;

WARNING: Variable ret1 already exists on file WORK._EVTRETS.

NOTE: Table WORK._EVTRETS created, with 316721 rows and 28 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1.65 seconds

      cpu time            2.66 seconds

      



### DONE!



### ESTIMATING FACTOR EXPOSURES OVER THE ESTIMATION PERIOD...

MPRINT(EVTSTUDY_NEW):   proc reg data=_evtrets edf outest=_params 

(rename=(intercept=alpha vwretd=beta smb=sminb hml=hminl mom=wminl) keep=permno 

_edate intercept vwretd smb hml mom _rmse_ _p_ _edf_) noprint;

MPRINT(EVTSTUDY_NEW):   where estper_beg<=date<=estper_end;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   model ret=vwretd smb hml mom;

MPRINT(EVTSTUDY_NEW):   quit;



NOTE: The data set WORK._PARAMS has 2577 observations and 10 variables.

NOTE: PROCEDURE REG used (Total process time):

      real time           0.61 seconds

      cpu time            0.59 seconds

      



### DONE!



### CALCULATING ONE-DAY ABNORMAL RETURN IN THE EVENT WINDOW...

MPRINT(EVTSTUDY_NEW):   data _abrets/view=_abrets;

MPRINT(EVTSTUDY_NEW):   merge _evtrets (where=(evtwin_beg<=date<=evtwin_end) 

in=a) _params;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   

abret=ret-alpha-beta*vwretd-sminb*smb-hminl*hml-wminl*mom;

MPRINT(EVTSTUDY_NEW):   logret=log(1+ret);

MPRINT(EVTSTUDY_NEW):   var_estp=_rmse_*_rmse_;

MPRINT(EVTSTUDY_NEW):   nobs=_p_+_edf_;

MPRINT(EVTSTUDY_NEW):   label var_estp= 'Estimation Period Variance' abret= 

'One-day Abnormal Return (AR)' ret= 'Raw Return' _edate= 'Event Date' evttime= 

"Trading day within (-1,1) event window";

MPRINT(EVTSTUDY_NEW):   drop _p_ _edf_ estper_beg estper_end;

MPRINT(EVTSTUDY_NEW):   if a;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: DATA STEP view saved on file WORK._ABRETS.

NOTE: A stored DATA STEP view cannot run under a different operating system.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



### DONE!



### CALCULATING CARS AND VARIOUS STATISTICS...

MPRINT(EVTSTUDY_NEW):   proc means data=_abrets noprint;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   id var_estp;

MPRINT(EVTSTUDY_NEW):   output out=_car sum(logret)=cret sum(abret)=car 

n(abret)=nrets;

NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 563:157   1 at 563:162   2 at 563:189   2 at 563:211   2 at 565:4

NOTE: View WORK._ABRETS.VIEW used (Total process time):

      real time           0.12 seconds

      cpu time            0.12 seconds

      

NOTE: There were 7733 observations read from the data set WORK._EVTRETS.

      WHERE (evtwin_beg<=date) and (date<=evtwin_end);

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: There were 7733 observations read from the data set WORK._ABRETS.

NOTE: The data set WORK._CAR has 2578 observations and 8 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.14 seconds

      cpu time            0.12 seconds

      



MPRINT(EVTSTUDY_NEW):   data _car;

MPRINT(EVTSTUDY_NEW):   set _car;

MPRINT(EVTSTUDY_NEW):   poscar=car>0;

MPRINT(EVTSTUDY_NEW):   scar=car/(3*var_estp)**0.5;

MPRINT(EVTSTUDY_NEW):   cret=exp(cret)-1;

MPRINT(EVTSTUDY_NEW):   label poscar= 'Positive Abnormal Return Dummy' scar= 

'Standardized Cumulative Abnormal Return (SCAR)' car= 'Cumulative Abnormal 

Return (CAR)' cret= 'Cumulative Raw Return' nrets= 'Number of non-missing 

abnormal returns within event window';



NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 576:214   

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: The data set WORK._CAR has 2578 observations and 10 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



MPRINT(EVTSTUDY_NEW):   proc means data=_car noprint;

MPRINT(EVTSTUDY_NEW):   var cret car scar poscar;

MPRINT(EVTSTUDY_NEW):   class ;

MPRINT(EVTSTUDY_NEW):   output out=_test mean= n= t=/autoname;

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: The data set WORK._TEST has 1 observations and 14 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.01 seconds

      cpu time            0.00 seconds

      



MPRINT(EVTSTUDY_NEW):   data car_t;

MPRINT(EVTSTUDY_NEW):   set _test;

MPRINT(EVTSTUDY_NEW):   tpatell=scar_mean*((scar_n)**0.5);

MPRINT(EVTSTUDY_NEW):   tsign=(poscar_mean-0.5)/sqrt(0.25/poscar_n);

MPRINT(EVTSTUDY_NEW):   format cret_mean car_mean percent7.5;

MPRINT(EVTSTUDY_NEW):   label tpatell= "Patell's t-stat" car_mean= 'Mean 

Cumulative Abnormal Return' cret_mean= 'Mean Cumulative Raw Return' scar_mean= 

'Mean Cumulative Standardized Abnormal Return' car_t= 'Cross-sectional t-stat' 

scar_t= "Boehmer's et al. (1991) t-stat" car_n= 'Number of events in the 

portfolio' poscar_mean= 'Percent of positive abnormal returns' tsign= 

'Sign-test statistic';

MPRINT(EVTSTUDY_NEW):   drop cret_N scar_N poscar_N cret_t poscar_t;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 1 observations read from the data set WORK._TEST.

NOTE: The data set WORK.CAR_T has 1 observations and 11 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.02 seconds

      



### DONE!

MPRINT(EVTSTUDY_NEW):   proc print label u;

MPRINT(EVTSTUDY_NEW):   title1 "Output for dataset rep2 for a   (-1,1) event 

window using ffm model";

MPRINT(EVTSTUDY_NEW):   id ;

MPRINT(EVTSTUDY_NEW):   var cret_mean car_mean scar_mean poscar_mean car_n 

tsign tpatell car_t scar_t;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: Writing HTML Body file: sashtml.htm

NOTE: Non-portable document will be produced. The current settings of FORMCHAR use nonstandard 

      line-drawing characters and the resulting output file will not render correctly unless all 

      readers of the document have the SAS Monospace font installed. To make your document portable, 

      issue the following command: 

      OPTIONS FORMCHAR="|----|+|---+=|-/\<>*";



NOTE: There were 1 observations read from the data set WORK.CAR_T.

NOTE: At least one W.D format was too small for the number to be printed. The 

      decimal may be shifted by the "BEST" format.

NOTE: The PROCEDURE PRINT printed page 1.

NOTE: PROCEDURE PRINT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



MPRINT(EVTSTUDY_NEW):   data car1;

MPRINT(EVTSTUDY_NEW):   merge _temp (in=a rename=(news_date=_edate)) 

_abrets(keep=permno _edate date evttime ret abret var_estp) _car (keep=permno 

_edate cret car scar nrets) _params(keep=permno _edate beta);

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   rename _edate=news_date;

MPRINT(EVTSTUDY_NEW):   label _edate= 'Event date' date= 'Trading date in event 

window' beta= 'Beta';

MPRINT(EVTSTUDY_NEW):   format _edate date9. date date9.;

MPRINT(EVTSTUDY_NEW):   if a;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 563:157   1 at 563:162   2 at 563:189   2 at 563:211   2 at 565:4

NOTE: View WORK._ABRETS.VIEW used (Total process time):

      real time           0.09 seconds

      cpu time            0.09 seconds

      

NOTE: There were 7733 observations read from the data set WORK._EVTRETS.

      WHERE (evtwin_beg<=date) and (date<=evtwin_end);

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: There were 2578 observations read from the data set WORK._TEMP.

NOTE: There were 7733 observations read from the data set WORK._ABRETS.

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: The data set WORK.CAR1 has 7733 observations and 25 variables.

NOTE: DATA statement used (Total process time):

      real time           0.09 seconds

      cpu time            0.10 seconds

      



MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   drop table _caldates, _car, _factors, _test, _params, 

_temp, _evtrets,_evtrets1, _evtrets_temp, _caldates1, _temp1;

NOTE: Table WORK._CALDATES has been dropped.

NOTE: Table WORK._CAR has been dropped.

NOTE: Table WORK._FACTORS has been dropped.

NOTE: Table WORK._TEST has been dropped.

NOTE: Table WORK._PARAMS has been dropped.

NOTE: Table WORK._TEMP has been dropped.

NOTE: Table WORK._EVTRETS has been dropped.

NOTE: Table WORK._EVTRETS1 has been dropped.

NOTE: Table WORK._EVTRETS_TEMP has been dropped.

NOTE: Table WORK._CALDATES1 has been dropped.

NOTE: Table WORK._TEMP1 has been dropped.

MPRINT(EVTSTUDY_NEW):   drop view _abrets;

NOTE: View WORK._ABRETS has been dropped.

MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.02 seconds

      cpu time            0.02 seconds

      



MPRINT(EVTSTUDY_NEW):   options errors=20 NOMPRINT NOTES



### OUTPUT IN THE DATASET car1



### TEST STATISTICS IN THE DATASET car_t

285   

286   %EVTSTUDY_NEW (INSET=rep2, OUTSET=car2, OUTSTATS=car_t, ID=permno,

287   EVTDATE=news_date, ESTPER=110, START=0, END=1, GAP=10, GROUP=, MODEL=ffm);

MPRINT(EVTSTUDY_NEW):   errors=0;

MPRINT(EVTSTUDY_NEW):   *length of event window in trading days;



### CREATING TRADING DAY CALENDAR...

MPRINT(EVTSTUDY_NEW):   data _caldates;

MPRINT(EVTSTUDY_NEW):   merge crsp.dsi (keep=date rename=(date=estper_beg)) 

crsp.dsi (keep=date firstobs=110 rename=(date=estper_end)) crsp.dsi (keep=date 

firstobs=121 rename=(date=evtwin_beg)) crsp.dsi (keep=date firstobs=121 

rename=(date=news_date)) crsp.dsi (keep=date firstobs=122 

rename=(date=evtwin_end));

MPRINT(EVTSTUDY_NEW):   format estper_beg estper_end evtwin_beg news_date 

evtwin_end date9.;

MPRINT(EVTSTUDY_NEW):   if 

nmiss(estper_beg,estper_end,evtwin_beg,evtwin_end,news_date)=0;

MPRINT(EVTSTUDY_NEW):   time+1;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 26051 observations read from the data set CRSP.DSI.

NOTE: There were 25942 observations read from the data set CRSP.DSI.

NOTE: There were 25931 observations read from the data set CRSP.DSI.

NOTE: There were 25931 observations read from the data set CRSP.DSI.

NOTE: There were 25930 observations read from the data set CRSP.DSI.

NOTE: The data set WORK._CALDATES has 25930 observations and 6 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



### DONE!

MPRINT(EVTSTUDY_NEW):   proc sort data=rep2 out=_temp;

MPRINT(EVTSTUDY_NEW):   by permno news_date;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 2578 observations read from the data set WORK.REP2.

NOTE: The data set WORK._TEMP has 2578 observations and 15 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _caldates1 as select 

a.news_date,b.estper_beg,b.estper_end,b.evtwin_beg,b.evtwin_end,b.time from 

(select distinct news_date from _temp) a left join _caldates b on 

b.news_date-a.news_date>=0 group by a.news_date having 

(b.news_date-a.news_date)=min(b.news_date-a.news_date);

NOTE: The execution of this query involves performing one or more Cartesian 

      product joins that can not be optimized.

NOTE: The query requires remerging summary statistics back with the original 

      data.

NOTE: Table WORK._CALDATES1 created, with 813 rows and 6 columns.



MPRINT(EVTSTUDY_NEW):   create table _temp1 (drop=news_date) as select a.*, 

a.news_date as _edate format date9., b.* from _temp a left join _caldates1 

(drop=time) b on b.news_date=a.news_date;

NOTE: Table WORK._TEMP1 created, with 2578 rows and 19 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1.40 seconds

      cpu time            2.06 seconds

      





### PREPARING BENCHMARK FACTORS...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):  create table _factors as select a.date, a.vwretd, b.smb, 

b.hml, b.umd as mom from crsp.dsi (keep=date vwretd) a left join 

ff.factors_daily b on a.date=b.date;

NOTE: Table WORK._FACTORS created, with 26051 rows and 5 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.04 seconds

      cpu time            0.03 seconds

      



### DONE!



### RETRIEVING RETURNS DATA FROM CRSP...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _evtrets_temp as select a.permno, a.date 

format date9., a.ret as ret1, b.* from crsp.dsf a, _temp1 b where 

a.permno=b.permno and b.estper_beg<=a.date<=b.evtwin_end;

WARNING: Variable permno already exists on file WORK._EVTRETS_TEMP.

NOTE: Table WORK._EVTRETS_TEMP created, with 314149 rows and 21 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           11.44 seconds

      cpu time            10.52 seconds

      



### DONE!



### MERGING IN BECHMARK FACTORS...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _evtrets1 as select a.*, b.*, 

(c.time-d.time) as evttime from _evtrets_temp a left join _factors (keep=date 

vwretd smb hml mom) b on a.date=b.date left join _caldates c on 

a.date=c.news_date left join _caldates d on a._edate=d.news_date;

WARNING: Variable DATE already exists on file WORK._EVTRETS1.

NOTE: Table WORK._EVTRETS1 created, with 314149 rows and 26 columns.



MPRINT(EVTSTUDY_NEW):   create table _evtrets (where=(not missing(vwretd))) as 

select a.*, a.ret1 label='Ret unadjusted for delisting', 

(1+a.ret1)*sum(1,b.dlret)-1-a.vwretd as exret label='Market-adjusted total 

ret', (1+a.ret1)*sum(1,b.dlret)-1 as ret "Ret adjusted for delisting" from 

_evtrets1 a left join crsp.dsedelist (where=(missing(dlret)=0)) b on 

a.permno=b.permno and a.date=b.dlstdt order by a.permno,a._edate,a.date, 

a.evttime;

WARNING: Variable ret1 already exists on file WORK._EVTRETS.

NOTE: Table WORK._EVTRETS created, with 314149 rows and 28 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1.74 seconds

      cpu time            2.69 seconds

      



### DONE!



### ESTIMATING FACTOR EXPOSURES OVER THE ESTIMATION PERIOD...

MPRINT(EVTSTUDY_NEW):   proc reg data=_evtrets edf outest=_params 

(rename=(intercept=alpha vwretd=beta smb=sminb hml=hminl mom=wminl) keep=permno 

_edate intercept vwretd smb hml mom _rmse_ _p_ _edf_) noprint;

MPRINT(EVTSTUDY_NEW):   where estper_beg<=date<=estper_end;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   model ret=vwretd smb hml mom;

MPRINT(EVTSTUDY_NEW):   quit;



NOTE: The data set WORK._PARAMS has 2577 observations and 10 variables.

NOTE: PROCEDURE REG used (Total process time):

      real time           0.34 seconds

      cpu time            0.35 seconds

      



### DONE!



### CALCULATING ONE-DAY ABNORMAL RETURN IN THE EVENT WINDOW...

MPRINT(EVTSTUDY_NEW):   data _abrets/view=_abrets;

MPRINT(EVTSTUDY_NEW):   merge _evtrets (where=(evtwin_beg<=date<=evtwin_end) 

in=a) _params;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   

abret=ret-alpha-beta*vwretd-sminb*smb-hminl*hml-wminl*mom;

MPRINT(EVTSTUDY_NEW):   logret=log(1+ret);

MPRINT(EVTSTUDY_NEW):   var_estp=_rmse_*_rmse_;

MPRINT(EVTSTUDY_NEW):   nobs=_p_+_edf_;

MPRINT(EVTSTUDY_NEW):   label var_estp= 'Estimation Period Variance' abret= 

'One-day Abnormal Return (AR)' ret= 'Raw Return' _edate= 'Event Date' evttime= 

"Trading day within (0,1) event window";

MPRINT(EVTSTUDY_NEW):   drop _p_ _edf_ estper_beg estper_end;

MPRINT(EVTSTUDY_NEW):   if a;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: DATA STEP view saved on file WORK._ABRETS.

NOTE: A stored DATA STEP view cannot run under a different operating system.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



### DONE!



### CALCULATING CARS AND VARIOUS STATISTICS...

MPRINT(EVTSTUDY_NEW):   proc means data=_abrets noprint;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   id var_estp;

MPRINT(EVTSTUDY_NEW):   output out=_car sum(logret)=cret sum(abret)=car 

n(abret)=nrets;

NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 770:157   1 at 770:162   2 at 770:189   2 at 770:211   2 at 772:4

NOTE: View WORK._ABRETS.VIEW used (Total process time):

      real time           0.07 seconds

      cpu time            0.07 seconds

      

NOTE: There were 5156 observations read from the data set WORK._EVTRETS.

      WHERE (evtwin_beg<=date) and (date<=evtwin_end);

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: There were 5156 observations read from the data set WORK._ABRETS.

NOTE: The data set WORK._CAR has 2578 observations and 8 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.07 seconds

      cpu time            0.07 seconds

      



MPRINT(EVTSTUDY_NEW):   data _car;

MPRINT(EVTSTUDY_NEW):   set _car;

MPRINT(EVTSTUDY_NEW):   poscar=car>0;

MPRINT(EVTSTUDY_NEW):   scar=car/(2*var_estp)**0.5;

MPRINT(EVTSTUDY_NEW):   cret=exp(cret)-1;

MPRINT(EVTSTUDY_NEW):   label poscar= 'Positive Abnormal Return Dummy' scar= 

'Standardized Cumulative Abnormal Return (SCAR)' car= 'Cumulative Abnormal 

Return (CAR)' cret= 'Cumulative Raw Return' nrets= 'Number of non-missing 

abnormal returns within event window';



NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 783:214   

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: The data set WORK._CAR has 2578 observations and 10 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.02 seconds

      



MPRINT(EVTSTUDY_NEW):   proc means data=_car noprint;

MPRINT(EVTSTUDY_NEW):   var cret car scar poscar;

MPRINT(EVTSTUDY_NEW):   class ;

MPRINT(EVTSTUDY_NEW):   output out=_test mean= n= t=/autoname;

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: The data set WORK._TEST has 1 observations and 14 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



MPRINT(EVTSTUDY_NEW):   data car_t;

MPRINT(EVTSTUDY_NEW):   set _test;

MPRINT(EVTSTUDY_NEW):   tpatell=scar_mean*((scar_n)**0.5);

MPRINT(EVTSTUDY_NEW):   tsign=(poscar_mean-0.5)/sqrt(0.25/poscar_n);

MPRINT(EVTSTUDY_NEW):   format cret_mean car_mean percent7.5;

MPRINT(EVTSTUDY_NEW):   label tpatell= "Patell's t-stat" car_mean= 'Mean 

Cumulative Abnormal Return' cret_mean= 'Mean Cumulative Raw Return' scar_mean= 

'Mean Cumulative Standardized Abnormal Return' car_t= 'Cross-sectional t-stat' 

scar_t= "Boehmer's et al. (1991) t-stat" car_n= 'Number of events in the 

portfolio' poscar_mean= 'Percent of positive abnormal returns' tsign= 

'Sign-test statistic';

MPRINT(EVTSTUDY_NEW):   drop cret_N scar_N poscar_N cret_t poscar_t;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 1 observations read from the data set WORK._TEST.

NOTE: The data set WORK.CAR_T has 1 observations and 11 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



### DONE!

MPRINT(EVTSTUDY_NEW):   proc print label u;

MPRINT(EVTSTUDY_NEW):   title1 "Output for dataset rep2 for a   (0,1) event 

window using ffm model";

MPRINT(EVTSTUDY_NEW):   id ;

MPRINT(EVTSTUDY_NEW):   var cret_mean car_mean scar_mean poscar_mean car_n 

tsign tpatell car_t scar_t;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 1 observations read from the data set WORK.CAR_T.

NOTE: At least one W.D format was too small for the number to be printed. The 

      decimal may be shifted by the "BEST" format.

NOTE: The PROCEDURE PRINT printed page 2.

NOTE: PROCEDURE PRINT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



MPRINT(EVTSTUDY_NEW):   data car2;

MPRINT(EVTSTUDY_NEW):   merge _temp (in=a rename=(news_date=_edate)) 

_abrets(keep=permno _edate date evttime ret abret var_estp) _car (keep=permno 

_edate cret car scar nrets) _params(keep=permno _edate beta);

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   rename _edate=news_date;

MPRINT(EVTSTUDY_NEW):   label _edate= 'Event date' date= 'Trading date in event 

window' beta= 'Beta';

MPRINT(EVTSTUDY_NEW):   format _edate date9. date date9.;

MPRINT(EVTSTUDY_NEW):   if a;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 770:157   1 at 770:162   2 at 770:189   2 at 770:211   2 at 772:4

NOTE: View WORK._ABRETS.VIEW used (Total process time):

      real time           0.05 seconds

      cpu time            0.06 seconds

      

NOTE: There were 5156 observations read from the data set WORK._EVTRETS.

      WHERE (evtwin_beg<=date) and (date<=evtwin_end);

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: There were 2578 observations read from the data set WORK._TEMP.

NOTE: There were 5156 observations read from the data set WORK._ABRETS.

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: The data set WORK.CAR2 has 5156 observations and 25 variables.

NOTE: DATA statement used (Total process time):

      real time           0.06 seconds

      cpu time            0.06 seconds

      



MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   drop table _caldates, _car, _factors, _test, _params, 

_temp, _evtrets,_evtrets1, _evtrets_temp, _caldates1, _temp1;

NOTE: Table WORK._CALDATES has been dropped.

NOTE: Table WORK._CAR has been dropped.

NOTE: Table WORK._FACTORS has been dropped.

NOTE: Table WORK._TEST has been dropped.

NOTE: Table WORK._PARAMS has been dropped.

NOTE: Table WORK._TEMP has been dropped.

NOTE: Table WORK._EVTRETS has been dropped.

NOTE: Table WORK._EVTRETS1 has been dropped.

NOTE: Table WORK._EVTRETS_TEMP has been dropped.

NOTE: Table WORK._CALDATES1 has been dropped.

NOTE: Table WORK._TEMP1 has been dropped.

MPRINT(EVTSTUDY_NEW):   drop view _abrets;

NOTE: View WORK._ABRETS has been dropped.

MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



MPRINT(EVTSTUDY_NEW):   options errors=20 NOMPRINT NOTES



### OUTPUT IN THE DATASET car2



### TEST STATISTICS IN THE DATASET car_t

288   

289   %EVTSTUDY_NEW (INSET=rep2, OUTSET=car3, OUTSTATS=car_t, ID=permno,

290   EVTDATE=news_date, ESTPER=110, START=0, END=2, GAP=10, GROUP=, MODEL=ffm);

MPRINT(EVTSTUDY_NEW):   errors=0;

MPRINT(EVTSTUDY_NEW):   *length of event window in trading days;



### CREATING TRADING DAY CALENDAR...

MPRINT(EVTSTUDY_NEW):   data _caldates;

MPRINT(EVTSTUDY_NEW):   merge crsp.dsi (keep=date rename=(date=estper_beg)) 

crsp.dsi (keep=date firstobs=110 rename=(date=estper_end)) crsp.dsi (keep=date 

firstobs=121 rename=(date=evtwin_beg)) crsp.dsi (keep=date firstobs=121 

rename=(date=news_date)) crsp.dsi (keep=date firstobs=123 

rename=(date=evtwin_end));

MPRINT(EVTSTUDY_NEW):   format estper_beg estper_end evtwin_beg news_date 

evtwin_end date9.;

MPRINT(EVTSTUDY_NEW):   if 

nmiss(estper_beg,estper_end,evtwin_beg,evtwin_end,news_date)=0;

MPRINT(EVTSTUDY_NEW):   time+1;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 26051 observations read from the data set CRSP.DSI.

NOTE: There were 25942 observations read from the data set CRSP.DSI.

NOTE: There were 25931 observations read from the data set CRSP.DSI.

NOTE: There were 25931 observations read from the data set CRSP.DSI.

NOTE: There were 25929 observations read from the data set CRSP.DSI.

NOTE: The data set WORK._CALDATES has 25929 observations and 6 variables.

NOTE: DATA statement used (Total process time):

      real time           0.04 seconds

      cpu time            0.03 seconds

      



### DONE!

MPRINT(EVTSTUDY_NEW):   proc sort data=rep2 out=_temp;

MPRINT(EVTSTUDY_NEW):   by permno news_date;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 2578 observations read from the data set WORK.REP2.

NOTE: The data set WORK._TEMP has 2578 observations and 15 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _caldates1 as select 

a.news_date,b.estper_beg,b.estper_end,b.evtwin_beg,b.evtwin_end,b.time from 

(select distinct news_date from _temp) a left join _caldates b on 

b.news_date-a.news_date>=0 group by a.news_date having 

(b.news_date-a.news_date)=min(b.news_date-a.news_date);

NOTE: The execution of this query involves performing one or more Cartesian 

      product joins that can not be optimized.

NOTE: The query requires remerging summary statistics back with the original 

      data.

NOTE: Table WORK._CALDATES1 created, with 813 rows and 6 columns.



MPRINT(EVTSTUDY_NEW):   create table _temp1 (drop=news_date) as select a.*, 

a.news_date as _edate format date9., b.* from _temp a left join _caldates1 

(drop=time) b on b.news_date=a.news_date;

NOTE: Table WORK._TEMP1 created, with 2578 rows and 19 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1.67 seconds

      cpu time            2.34 seconds

      





### PREPARING BENCHMARK FACTORS...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):  create table _factors as select a.date, a.vwretd, b.smb, 

b.hml, b.umd as mom from crsp.dsi (keep=date vwretd) a left join 

ff.factors_daily b on a.date=b.date;

NOTE: Table WORK._FACTORS created, with 26051 rows and 5 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.04 seconds

      cpu time            0.03 seconds

      



### DONE!



### RETRIEVING RETURNS DATA FROM CRSP...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _evtrets_temp as select a.permno, a.date 

format date9., a.ret as ret1, b.* from crsp.dsf a, _temp1 b where 

a.permno=b.permno and b.estper_beg<=a.date<=b.evtwin_end;

WARNING: Variable permno already exists on file WORK._EVTRETS_TEMP.

NOTE: Table WORK._EVTRETS_TEMP created, with 316727 rows and 21 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           9.97 seconds

      cpu time            9.29 seconds

      



### DONE!



### MERGING IN BECHMARK FACTORS...

MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   create table _evtrets1 as select a.*, b.*, 

(c.time-d.time) as evttime from _evtrets_temp a left join _factors (keep=date 

vwretd smb hml mom) b on a.date=b.date left join _caldates c on 

a.date=c.news_date left join _caldates d on a._edate=d.news_date;

WARNING: Variable DATE already exists on file WORK._EVTRETS1.

NOTE: Table WORK._EVTRETS1 created, with 316727 rows and 26 columns.



MPRINT(EVTSTUDY_NEW):   create table _evtrets (where=(not missing(vwretd))) as 

select a.*, a.ret1 label='Ret unadjusted for delisting', 

(1+a.ret1)*sum(1,b.dlret)-1-a.vwretd as exret label='Market-adjusted total 

ret', (1+a.ret1)*sum(1,b.dlret)-1 as ret "Ret adjusted for delisting" from 

_evtrets1 a left join crsp.dsedelist (where=(missing(dlret)=0)) b on 

a.permno=b.permno and a.date=b.dlstdt order by a.permno,a._edate,a.date, 

a.evttime;

WARNING: Variable ret1 already exists on file WORK._EVTRETS.

NOTE: Table WORK._EVTRETS created, with 316727 rows and 28 columns.



MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           1.82 seconds

      cpu time            2.83 seconds

      



### DONE!



### ESTIMATING FACTOR EXPOSURES OVER THE ESTIMATION PERIOD...

MPRINT(EVTSTUDY_NEW):   proc reg data=_evtrets edf outest=_params 

(rename=(intercept=alpha vwretd=beta smb=sminb hml=hminl mom=wminl) keep=permno 

_edate intercept vwretd smb hml mom _rmse_ _p_ _edf_) noprint;

MPRINT(EVTSTUDY_NEW):   where estper_beg<=date<=estper_end;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   model ret=vwretd smb hml mom;

MPRINT(EVTSTUDY_NEW):   quit;



NOTE: The data set WORK._PARAMS has 2577 observations and 10 variables.

NOTE: PROCEDURE REG used (Total process time):

      real time           0.54 seconds

      cpu time            0.53 seconds

      



### DONE!



### CALCULATING ONE-DAY ABNORMAL RETURN IN THE EVENT WINDOW...

MPRINT(EVTSTUDY_NEW):   data _abrets/view=_abrets;

MPRINT(EVTSTUDY_NEW):   merge _evtrets (where=(evtwin_beg<=date<=evtwin_end) 

in=a) _params;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   

abret=ret-alpha-beta*vwretd-sminb*smb-hminl*hml-wminl*mom;

MPRINT(EVTSTUDY_NEW):   logret=log(1+ret);

MPRINT(EVTSTUDY_NEW):   var_estp=_rmse_*_rmse_;

MPRINT(EVTSTUDY_NEW):   nobs=_p_+_edf_;

MPRINT(EVTSTUDY_NEW):   label var_estp= 'Estimation Period Variance' abret= 

'One-day Abnormal Return (AR)' ret= 'Raw Return' _edate= 'Event Date' evttime= 

"Trading day within (0,2) event window";

MPRINT(EVTSTUDY_NEW):   drop _p_ _edf_ estper_beg estper_end;

MPRINT(EVTSTUDY_NEW):   if a;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: DATA STEP view saved on file WORK._ABRETS.

NOTE: A stored DATA STEP view cannot run under a different operating system.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



### DONE!



### CALCULATING CARS AND VARIOUS STATISTICS...

MPRINT(EVTSTUDY_NEW):   proc means data=_abrets noprint;

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   id var_estp;

MPRINT(EVTSTUDY_NEW):   output out=_car sum(logret)=cret sum(abret)=car 

n(abret)=nrets;

NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 977:157   1 at 977:162   3 at 977:189   3 at 977:211   3 at 979:4

NOTE: View WORK._ABRETS.VIEW used (Total process time):

      real time           0.11 seconds

      cpu time            0.11 seconds

      

NOTE: There were 7734 observations read from the data set WORK._EVTRETS.

      WHERE (evtwin_beg<=date) and (date<=evtwin_end);

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: There were 7734 observations read from the data set WORK._ABRETS.

NOTE: The data set WORK._CAR has 2578 observations and 8 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.11 seconds

      cpu time            0.11 seconds

      



MPRINT(EVTSTUDY_NEW):   data _car;

MPRINT(EVTSTUDY_NEW):   set _car;

MPRINT(EVTSTUDY_NEW):   poscar=car>0;

MPRINT(EVTSTUDY_NEW):   scar=car/(3*var_estp)**0.5;

MPRINT(EVTSTUDY_NEW):   cret=exp(cret)-1;

MPRINT(EVTSTUDY_NEW):   label poscar= 'Positive Abnormal Return Dummy' scar= 

'Standardized Cumulative Abnormal Return (SCAR)' car= 'Cumulative Abnormal 

Return (CAR)' cret= 'Cumulative Raw Return' nrets= 'Number of non-missing 

abnormal returns within event window';



NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 990:214   

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: The data set WORK._CAR has 2578 observations and 10 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



MPRINT(EVTSTUDY_NEW):   proc means data=_car noprint;

MPRINT(EVTSTUDY_NEW):   var cret car scar poscar;

MPRINT(EVTSTUDY_NEW):   class ;

MPRINT(EVTSTUDY_NEW):   output out=_test mean= n= t=/autoname;

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: The data set WORK._TEST has 1 observations and 14 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



MPRINT(EVTSTUDY_NEW):   data car_t;

MPRINT(EVTSTUDY_NEW):   set _test;

MPRINT(EVTSTUDY_NEW):   tpatell=scar_mean*((scar_n)**0.5);

MPRINT(EVTSTUDY_NEW):   tsign=(poscar_mean-0.5)/sqrt(0.25/poscar_n);

MPRINT(EVTSTUDY_NEW):   format cret_mean car_mean percent7.5;

MPRINT(EVTSTUDY_NEW):   label tpatell= "Patell's t-stat" car_mean= 'Mean 

Cumulative Abnormal Return' cret_mean= 'Mean Cumulative Raw Return' scar_mean= 

'Mean Cumulative Standardized Abnormal Return' car_t= 'Cross-sectional t-stat' 

scar_t= "Boehmer's et al. (1991) t-stat" car_n= 'Number of events in the 

portfolio' poscar_mean= 'Percent of positive abnormal returns' tsign= 

'Sign-test statistic';

MPRINT(EVTSTUDY_NEW):   drop cret_N scar_N poscar_N cret_t poscar_t;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 1 observations read from the data set WORK._TEST.

NOTE: The data set WORK.CAR_T has 1 observations and 11 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



### DONE!

MPRINT(EVTSTUDY_NEW):   proc print label u;

MPRINT(EVTSTUDY_NEW):   title1 "Output for dataset rep2 for a   (0,2) event 

window using ffm model";

MPRINT(EVTSTUDY_NEW):   id ;

MPRINT(EVTSTUDY_NEW):   var cret_mean car_mean scar_mean poscar_mean car_n 

tsign tpatell car_t scar_t;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: There were 1 observations read from the data set WORK.CAR_T.

NOTE: At least one W.D format was too small for the number to be printed. The 

      decimal may be shifted by the "BEST" format.

NOTE: The PROCEDURE PRINT printed page 3.

NOTE: PROCEDURE PRINT used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



MPRINT(EVTSTUDY_NEW):   data car3;

MPRINT(EVTSTUDY_NEW):   merge _temp (in=a rename=(news_date=_edate)) 

_abrets(keep=permno _edate date evttime ret abret var_estp) _car (keep=permno 

_edate cret car scar nrets) _params(keep=permno _edate beta);

MPRINT(EVTSTUDY_NEW):   by permno _edate;

MPRINT(EVTSTUDY_NEW):   rename _edate=news_date;

MPRINT(EVTSTUDY_NEW):   label _edate= 'Event date' date= 'Trading date in event 

window' beta= 'Beta';

MPRINT(EVTSTUDY_NEW):   format _edate date9. date date9.;

MPRINT(EVTSTUDY_NEW):   if a;

MPRINT(EVTSTUDY_NEW):   run;



NOTE: Missing values were generated as a result of performing an operation on 

      missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 977:157   1 at 977:162   3 at 977:189   3 at 977:211   3 at 979:4

NOTE: View WORK._ABRETS.VIEW used (Total process time):

      real time           0.10 seconds

      cpu time            0.10 seconds

      

NOTE: There were 7734 observations read from the data set WORK._EVTRETS.

      WHERE (evtwin_beg<=date) and (date<=evtwin_end);

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: There were 2578 observations read from the data set WORK._TEMP.

NOTE: There were 7734 observations read from the data set WORK._ABRETS.

NOTE: There were 2578 observations read from the data set WORK._CAR.

NOTE: There were 2577 observations read from the data set WORK._PARAMS.

NOTE: The data set WORK.CAR3 has 7734 observations and 25 variables.

NOTE: DATA statement used (Total process time):

      real time           0.10 seconds

      cpu time            0.10 seconds

      



MPRINT(EVTSTUDY_NEW):   proc sql;

MPRINT(EVTSTUDY_NEW):   drop table _caldates, _car, _factors, _test, _params, 

_temp, _evtrets,_evtrets1, _evtrets_temp, _caldates1, _temp1;

NOTE: Table WORK._CALDATES has been dropped.

NOTE: Table WORK._CAR has been dropped.

NOTE: Table WORK._FACTORS has been dropped.

NOTE: Table WORK._TEST has been dropped.

NOTE: Table WORK._PARAMS has been dropped.

NOTE: Table WORK._TEMP has been dropped.

NOTE: Table WORK._EVTRETS has been dropped.

NOTE: Table WORK._EVTRETS1 has been dropped.

NOTE: Table WORK._EVTRETS_TEMP has been dropped.

NOTE: Table WORK._CALDATES1 has been dropped.

NOTE: Table WORK._TEMP1 has been dropped.

MPRINT(EVTSTUDY_NEW):   drop view _abrets;

NOTE: View WORK._ABRETS has been dropped.

MPRINT(EVTSTUDY_NEW):   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.02 seconds

      cpu time            0.03 seconds

      



MPRINT(EVTSTUDY_NEW):   options errors=20 NOMPRINT NOTES



### OUTPUT IN THE DATASET car3



### TEST STATISTICS IN THE DATASET car_t

291   

292   proc download data=car1 out=work.car1;run;





NOTE: Download in progress from data=WORK.CAR1 to out=WORK.CAR1

NOTE: 1546600 bytes were transferred at 1442723 bytes/second.

NOTE: The data set WORK.CAR1 has 7733 observations and 25 variables.

NOTE: Downloaded 7733 observations of 25 variables.

NOTE: The data set WORK.CAR1 has 7733 observations and 25 variables.

NOTE: PROCEDURE DOWNLOAD used (Total process time):

      real time           1.34 seconds

      cpu time            0.19 seconds

      



293   proc download data=car2 out=work.car2;run;





NOTE: Download in progress from data=WORK.CAR2 to out=WORK.CAR2

NOTE: 1031200 bytes were transferred at 1057640 bytes/second.

NOTE: The data set WORK.CAR2 has 5156 observations and 25 variables.

NOTE: Downloaded 5156 observations of 25 variables.

NOTE: The data set WORK.CAR2 has 5156 observations and 25 variables.

NOTE: PROCEDURE DOWNLOAD used (Total process time):

      real time           1.04 seconds

      cpu time            0.15 seconds

      



294   proc download data=car3 out=work.car3;run;





NOTE: Download in progress from data=WORK.CAR3 to out=WORK.CAR3

NOTE: 1546800 bytes were transferred at 1433549 bytes/second.

NOTE: The data set WORK.CAR3 has 7734 observations and 25 variables.

NOTE: Downloaded 7734 observations of 25 variables.

NOTE: The data set WORK.CAR3 has 7734 observations and 25 variables.

NOTE: PROCEDURE DOWNLOAD used (Total process time):

      real time           1.15 seconds

      cpu time            0.19 seconds

      



NOTE: Remote submit to WRDS complete.

39   

40   

41   %macro car;

42   %do i=1 %to 3;

43   

44   proc sort data=car&i nodupkey;

45   by cusip6 gvkey gvkey1 news_date evttime;

46   run;

47   

48   proc means data=car&i noprint;

49   by cusip6 gvkey gvkey1 news_date;

50   var abret;

51   output out=car&i(drop=_type_ _freq_)

52   sum=car&i n=freq;

53   run;

54   

55   

56   %end;

57   %mend;

58   %car;run;



NOTE: There were 7733 observations read from the data set WORK.CAR1.

NOTE: 598 observations with duplicate key values were deleted.

NOTE: The data set WORK.CAR1 has 7135 observations and 25 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      





NOTE: There were 7135 observations read from the data set WORK.CAR1.

NOTE: The data set WORK.CAR1 has 2578 observations and 6 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.02 seconds

      cpu time            0.00 seconds

      





NOTE: There were 5156 observations read from the data set WORK.CAR2.

NOTE: 299 observations with duplicate key values were deleted.

NOTE: The data set WORK.CAR2 has 4857 observations and 25 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      





NOTE: There were 4857 observations read from the data set WORK.CAR2.

NOTE: The data set WORK.CAR2 has 2578 observations and 6 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      





NOTE: There were 7734 observations read from the data set WORK.CAR3.

NOTE: 598 observations with duplicate key values were deleted.

NOTE: The data set WORK.CAR3 has 7136 observations and 25 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      





NOTE: There were 7136 observations read from the data set WORK.CAR3.

NOTE: The data set WORK.CAR3 has 2578 observations and 6 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



59   

60   

61   

62   data allcar;

63   merge car1 car2 car3;

64   by cusip6 gvkey gvkey1 news_date;

65   run;



NOTE: There were 2578 observations read from the data set WORK.CAR1.

NOTE: There were 2578 observations read from the data set WORK.CAR2.

NOTE: There were 2578 observations read from the data set WORK.CAR3.

NOTE: The data set WORK.ALLCAR has 2578 observations and 8 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



66   

67   proc sql;

68   create table ticnews as select

69   a.*, b.car1, b.car2, b.car3

70   from ticnews as a left join allcar as b

71   on a.cusip6 = b.cusip6

72   and a.gvkey = b.gvkey

73   and a.news_date = b.news_date

74   order by cusip6, gvkey, news_date;

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this 

         is a possible data integrity problem.

NOTE: Table WORK.TICNEWS created, with 2735 rows and 17 columns.



75   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



76   

77   proc export data = ticnews

78   outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\rep_car.dta"

79   dbms = '' replace;

80   run;



NOTE: The export data set has 2735 observations and 17 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\rep_car.dta" file was 

      successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           14:08.74

      cpu time            11.65 seconds

      



===== 6_Google.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



2    

3    

4    libname data "H:\project\ESG News and Customer\Data";

NOTE: Libref DATA was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: H:\project\ESG News and Customer\Data

4  !                                                       run;

5    

6    data google; set data.google_all;run;



NOTE: There were 272904 observations read from the data set DATA.GOOGLE_ALL.

NOTE: The data set WORK.GOOGLE has 272904 observations and 4 variables.

NOTE: DATA statement used (Total process time):

      real time           0.05 seconds

      cpu time            0.00 seconds

      



7    

8    proc import out=ticnewsdate

9    datafile = "H:\project\ESG News and Customer\Data\ticnewsdate1013.dta"

10   dbms = '' replace;

11   run;



NOTE: One or more variables were converted because the data type is not supported by the V9 engine. 

      For more details, run with options MSGLEVEL=I.

NOTE: The import data set has 2735 observations and 13 variables.

NOTE: WORK.TICNEWSDATE data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



12   

13   

14   proc sql;

15   

16   create table googleesg as select *

17   from ticnewsdate as a left join google as b

18   on a.tic=b.ticker

19   and b.date>=a.news_date-10

20   and b.date<=a.news_date+20

21   order by tic, news_date, date;

NOTE: Table WORK.GOOGLEESG created, with 84725 rows and 17 columns.



22   

23   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.11 seconds

      cpu time            0.11 seconds

      



24   

25   /*******Compustat control**********/

26   data qcompustat;

27   set data.compustat_quarter;

28   if atq>0;

29   if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

30   MVEQ=(PRCCQ*CSHOQ);

31   MTBQ=MVEQ/CEQQ;

32   BTMQ=CEQQ/MVEQ;

33   lnMVEQ=log(MVEQ);

34   lnATQ=log(ATQ);

35   *LEVQ=(DLTTQ+DLCQ)/ATQ;

36   *LEV_MVEQ=(DLTTQ+DLCQ)/MVEQ;

37   Leverageq=LTQ/ATQ;

38   IBQ_ATQ=IBQ/ATQ;

39   if IBQ<0 and IBQ ne . then Loss=1;

40   if IBQ>=0 and IBQ ne . then Loss=0;

41   lnsaleq=log(1+saleq);

42   run;



NOTE: Invalid argument to function LOG(-0.198) at line 41 column 9.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ACMTA

cusip=004616207 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=30APR2020 atq=55.544 ceqq=28.126

cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639 lctq=. ltq=27.418 saleq=-1.198 seqq=28.126 teqq=28.126

txdbq=0 capxy=0.015 exchg=19 costat=A prccq=32.3 sic=6351 MVEQ=25.6462 MTBQ=0.9118324682

BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995 Leverageq=0.4936266743 IBQ_ATQ=-0.029508138

Loss=1 lnsaleq=. _ERROR_=1 _N_=243

NOTE: Invalid argument to function LOG(-0.091) at line 41 column 9.

gvkey=001790 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=AB.

cusip=043420108 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=26JUN2020 atq=29.565 ceqq=-20.591

cheq=2.976 chq=0.187 cshoq=2.837 ibq=-0.318 lctq=4.728 ltq=50.156 saleq=-1.091 seqq=-20.591

teqq=-20.591 txdbq=0.324 capxy=0.002 exchg=9 costat=A prccq=0.35 sic=6799 MVEQ=0.99295

MTBQ=-0.048222524 BTMQ=-20.73719724 lnMVEQ=-0.007074969 lnATQ=3.3865912293 Leverageq=1.6964654152

IBQ_ATQ=-0.010755961 Loss=1 lnsaleq=. _ERROR_=1 _N_=1691

NOTE: Invalid argument to function LOG(-9009) at line 41 column 9.

gvkey=002176 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=BRK.B

cusip=084670702 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=02MAY2020 atq=760448 ceqq=371565

cheq=144480 chq=42640 cshoq=2430.035 ibq=-49746 lctq=. ltq=385213 saleq=-9010 seqq=371565 teqq=375235

txdbq=. capxy=2968 exchg=11 costat=A prccq=182.83 sic=9997 MVEQ=444283.29905 MTBQ=1.1957081508

BTMQ=0.8363244821 lnMVEQ=13.004217699 lnATQ=13.541663012 Leverageq=0.5065606064 IBQ_ATQ=-0.065416702

Loss=1 lnsaleq=. _ERROR_=1 _N_=2441

NOTE: Invalid argument to function LOG(-4.5) at line 41 column 9.

gvkey=011729 datadate=31DEC2016 fyearq=2016 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2016Q4 datafqtr=2016Q4 rdq=07FEB2017 atq=6544.7 ceqq=3603.3

cheq=650.1 chq=149.8 cshoq=4.564 ibq=-46.9 lctq=. ltq=2807.5 saleq=-5.5 seqq=3603.3 teqq=3737.2

txdbq=0 capxy=4.3 exchg=11 costat=A prccq=836.05 sic=6351 MVEQ=3815.7322 MTBQ=1.0589549025

BTMQ=0.9443272775 lnMVEQ=8.2468878519 lnATQ=8.7864108408 Leverageq=0.4289730622 IBQ_ATQ=-0.007166104

Loss=1 lnsaleq=. _ERROR_=1 _N_=21894

NOTE: Invalid argument to function LOG(-69.6) at line 41 column 9.

gvkey=011729 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=3739.7 ceqq=3076.7

cheq=274 chq=136.4 cshoq=3.135 ibq=-129.7 lctq=. ltq=780.6 saleq=-70.6 seqq=3076.7 teqq=2959.1 txdbq=.

capxy=0 exchg=11 costat=A prccq=910 sic=6351 MVEQ=2852.85 MTBQ=0.9272434752 BTMQ=1.0784653943

lnMVEQ=7.9560737736 lnATQ=8.2267606733 Leverageq=0.2087333209 IBQ_ATQ=-0.034681926 Loss=1 lnsaleq=.

_ERROR_=1 _N_=21907

NOTE: Invalid argument to function LOG(-1.058) at line 41 column 9.

gvkey=011957 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=TOF.U

cusip=87725P105 curcdq=CAD datacqtr=2018Q2 datafqtr=2018Q2 rdq=20AUG2018 atq=14.763 ceqq=13.986

cheq=14.721 chq=0.261 cshoq=1.411 ibq=-2.336 lctq=0.777 ltq=0.777 saleq=-2.058 seqq=13.986 teqq=13.986

txdbq=0 capxy=0 exchg=7 costat=I prccq=10.97 sic=6199 MVEQ=15.47867 MTBQ=1.1067260117

BTMQ=0.9035660041 lnMVEQ=2.7394629472 lnATQ=2.6921240506 Leverageq=0.0526315789 IBQ_ATQ=-0.158233421

Loss=1 lnsaleq=. _ERROR_=1 _N_=22530

NOTE: Invalid argument to function LOG(-28) at line 41 column 9.

gvkey=013561 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MBI

cusip=55262C100 curcdq=USD datacqtr=2018Q2 datafqtr=2018Q2 rdq=08AUG2018 atq=8699 ceqq=1103 cheq=675

chq=197 cshoq=90.662 ibq=-146 lctq=. ltq=7584 saleq=-29 seqq=1103 teqq=1115 txdbq=0 capxy=0 exchg=11

costat=A prccq=9.04 sic=6351 MVEQ=819.58448 MTBQ=0.7430502992 BTMQ=1.3458039127 lnMVEQ=6.7087974801

lnATQ=9.0709633555 Leverageq=0.8718243476 IBQ_ATQ=-0.016783538 Loss=1 lnsaleq=. _ERROR_=1 _N_=26114

NOTE: Invalid argument to function LOG(-42) at line 41 column 9.

gvkey=013709 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=IEP

cusip=451100101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=24306 ceqq=3635 cheq=3257

chq=2381 cshoq=214.186 ibq=-1384 lctq=. ltq=14889 saleq=-43 seqq=3635 teqq=9417 txdbq=533 capxy=53

exchg=14 costat=A prccq=48.42 sic=9997 MVEQ=10370.88612 MTBQ=2.8530635818 BTMQ=0.3505004257

lnMVEQ=9.2467577479 lnATQ=10.098478512 Leverageq=0.6125647988 IBQ_ATQ=-0.056940673 Loss=1 lnsaleq=.

_ERROR_=1 _N_=26550

NOTE: Invalid argument to function LOG(-989) at line 41 column 9.

gvkey=014326 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ONEXF

cusip=68272K103 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=15MAY2020 atq=6184 ceqq=5904 cheq=813

chq=379 cshoq=99.159 ibq=-997 lctq=. ltq=280 saleq=-990 seqq=5904 teqq=5904 txdbq=. capxy=0 exchg=19

costat=A prccq=. sic=6799 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=. lnATQ=8.7297205903 Leverageq=0.0452781371

IBQ_ATQ=-0.16122251 Loss=1 lnsaleq=. _ERROR_=1 _N_=28182

NOTE: Invalid argument to function LOG(-98) at line 41 column 9.

gvkey=014824 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=CINF

cusip=172062101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=27APR2020 atq=23367 ceqq=8042 cheq=988

chq=486 cshoq=160.8 ibq=-1226 lctq=. ltq=15325 saleq=-99 seqq=8042 teqq=8042 txdbq=660 capxy=4

exchg=14 costat=A prccq=75.45 sic=6331 MVEQ=12132.36 MTBQ=1.5086247202 BTMQ=0.6628553719

lnMVEQ=9.403631542 lnATQ=10.05908005 Leverageq=0.6558394317 IBQ_ATQ=-0.052467155 Loss=1 lnsaleq=.

_ERROR_=1 _N_=30164

NOTE: Invalid argument to function LOG(-69.092) at line 41 column 9.

gvkey=015082 datadate=31MAR2016 fyearq=2016 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2016Q1 datafqtr=2016Q1 rdq=13MAY2016 atq=1870.033 ceqq=676.583

cheq=8.444 chq=7.986 cshoq=2.817 ibq=-54.83 lctq=. ltq=1125.576 saleq=-70.092 seqq=676.583

teqq=744.457 txdbq=13.752 capxy=0 exchg=19 costat=A prccq=125.77 sic=6799 MVEQ=354.29409

MTBQ=0.5236520723 BTMQ=1.909664934 lnMVEQ=5.870127331 lnATQ=7.5337113568 Leverageq=0.6019016777

IBQ_ATQ=-0.029320338 Loss=1 lnsaleq=. _ERROR_=1 _N_=31037

NOTE: Invalid argument to function LOG(-189.836) at line 41 column 9.

gvkey=015082 datadate=31DEC2018 fyearq=2018 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2018Q4 datafqtr=2018Q4 rdq=29MAR2019 atq=2756.97 ceqq=864.636

cheq=121.017 chq=120.555 cshoq=2.689 ibq=-152.197 lctq=. ltq=1787.549 saleq=-190.836 seqq=864.636

teqq=969.421 txdbq=25.782 capxy=0 exchg=19 costat=A prccq=161.01 sic=6799 MVEQ=432.95589

MTBQ=0.5007377555 BTMQ=1.9970533257 lnMVEQ=6.0706358521 lnATQ=7.9218875296 Leverageq=0.6483744836

IBQ_ATQ=-0.055204445 Loss=1 lnsaleq=. _ERROR_=1 _N_=31048

NOTE: Invalid argument to function LOG(-37.16) at line 41 column 9.

gvkey=015082 datadate=30JUN2019 fyearq=2019 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2019Q2 datafqtr=2019Q2 rdq=12AUG2019 atq=2548.264 ceqq=825.661

cheq=18.074 chq=17.609 cshoq=2.676 ibq=-56.555 lctq=. ltq=1704.613 saleq=-38.16 seqq=825.661

teqq=843.651 txdbq=22.483 capxy=0 exchg=19 costat=A prccq=168.61 sic=6799 MVEQ=451.20036

MTBQ=0.5464716875 BTMQ=1.829920969 lnMVEQ=6.1119114981 lnATQ=7.843167622 Leverageq=0.6689310841

IBQ_ATQ=-0.02219354 Loss=1 lnsaleq=. _ERROR_=1 _N_=31050

NOTE: Invalid argument to function LOG(-350.373) at line 41 column 9.

gvkey=015082 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=1980.88 ceqq=639.374

cheq=17.261 chq=16.796 cshoq=2.634 ibq=-341.993 lctq=. ltq=1325.132 saleq=-351.373 seqq=639.374

teqq=655.748 txdbq=25.959 capxy=0 exchg=19 costat=A prccq=109.99 sic=6799 MVEQ=289.71366

MTBQ=0.4531208025 BTMQ=2.2069169952 lnMVEQ=5.6688930559 lnATQ=7.5912964694 Leverageq=0.6689612697

IBQ_ATQ=-0.172647005 Loss=1 lnsaleq=. _ERROR_=1 _N_=31053

NOTE: Invalid argument to function LOG(-222.641) at line 41 column 9.

gvkey=015101 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MFA

cusip=55272X102 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=16JUN2020 atq=11130.337 ceqq=2440.485

cheq=333.367 chq=116.465 cshoq=453.138 ibq=-908.995 lctq=. ltq=8689.662 saleq=-223.641 seqq=2440.675

teqq=2440.675 txdbq=0 capxy=0 exchg=11 costat=A prccq=1.55 sic=6798 MVEQ=702.3639 MTBQ=0.2877968519

BTMQ=3.4746731716 lnMVEQ=6.5544516458 lnATQ=9.3174297223 Leverageq=0.780718679 IBQ_ATQ=-0.081668237

Loss=1 lnsaleq=. _ERROR_=1 _N_=31193

NOTE: Invalid argument to function LOG(-33.625) at line 41 column 9.

gvkey=015452 datadate=30JUN2016 fyearq=2016 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q2 datafqtr=2016Q2 rdq=05AUG2016 atq=17.55 ceqq=4.35

cheq=0.847 chq=0.847 cshoq=244.247 ibq=-35.485 lctq=13.2 ltq=13.2 saleq=-34.625 seqq=4.35 teqq=4.35

txdbq=0 capxy=0 exchg=19 costat=A prccq=0.072 sic=1311 MVEQ=17.585784 MTBQ=4.0427089655

BTMQ=0.2473588894 lnMVEQ=2.8670908484 lnATQ=2.8650539499 Leverageq=0.7521367521 IBQ_ATQ=-2.021937322

Loss=1 lnsaleq=. _ERROR_=1 _N_=32451

NOTE: Invalid argument to function LOG(-9.899) at line 41 column 9.

gvkey=015452 datadate=30SEP2016 fyearq=2016 fqtr=3 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q3 datafqtr=2016Q3 rdq=07NOV2016 atq=6.323 ceqq=-5.13

cheq=0.847 chq=0.847 cshoq=251.645 ibq=-10.927 lctq=11.453 ltq=11.453 saleq=-10.899 seqq=-5.13

teqq=-5.13 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.045 sic=1311 MVEQ=11.324025 MTBQ=-2.207412281

BTMQ=-0.453019134 lnMVEQ=2.4269265749 lnATQ=1.8441937791 Leverageq=1.8113237387 IBQ_ATQ=-1.728135379

Loss=1 lnsaleq=. _ERROR_=1 _N_=32452

NOTE: Invalid argument to function LOG(-4.947) at line 41 column 9.

gvkey=016187 datadate=31MAR2017 fyearq=2017 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2017Q1 datafqtr=2017Q1 rdq=04MAY2017 atq=3852.675 ceqq=806.124

cheq=1475.115 chq=115.677 cshoq=0.264 ibq=-17.725 lctq=. ltq=3046.551 saleq=-5.947 seqq=806.124

teqq=806.124 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=8.2565229912 Leverageq=0.7907625221 IBQ_ATQ=-0.0046007 Loss=1 lnsaleq=. _ERROR_=1 _N_=34057

NOTE: Invalid argument to function LOG(-2.939) at line 41 column 9.

gvkey=016187 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=06MAY2020 atq=1484.296 ceqq=667.972

cheq=909.717 chq=131.826 cshoq=0.264 ibq=-7.591 lctq=. ltq=816.324 saleq=-3.939 seqq=667.972

teqq=667.972 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=7.3026958648 Leverageq=0.5499738597 IBQ_ATQ=-0.005114209 Loss=1 lnsaleq=. _ERROR_=1 _N_=34069

NOTE: Invalid argument to function LOG(-1956) at line 41 column 9.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=016384 datadate=31MAR2021 fyearq=2021 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=VOYA

cusip=929089100 curcdq=USD datacqtr=2021Q1 datafqtr=2021Q1 rdq=10MAY2021 atq=162861 ceqq=7931

cheq=3182 chq=1316 cshoq=121.222 ibq=1086 lctq=. ltq=153862 saleq=-1957 seqq=7931 teqq=8999 txdbq=0

capxy=0 exchg=11 costat=A prccq=63.64 sic=6311 MVEQ=7714.56808 MTBQ=0.9727106393 BTMQ=1.0280549627

lnMVEQ=8.9508657788 lnATQ=12.000652355 Leverageq=0.9447442911 IBQ_ATQ=0.0066682631 Loss=0 lnsaleq=.

_ERROR_=1 _N_=34258

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      12941 at 30:12   13505 at 31:10   13505 at 32:10   12941 at 33:8    155 at 37:14

      624 at 38:12     1478 at 41:9     1478 at 41:14    

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 31:10   1 at 32:10    1 at 33:8     243 at 41:9   

NOTE: There were 251509 observations read from the data set DATA.COMPUSTAT_QUARTER.

NOTE: The data set WORK.QCOMPUSTAT has 167464 observations and 40 variables.

NOTE: DATA statement used (Total process time):

      real time           0.23 seconds

      cpu time            0.01 seconds

      



43   

44   proc sort nodupkey data=qcompustat; by gvkey datadate; run;



NOTE: There were 167464 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 93 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 40 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.05 seconds

      cpu time            0.04 seconds

      



45   

46   data qcompustat;

47   set qcompustat;

48   cusip6=substr(cusip,1,6);

49   lagCAPXY=lag(CAPXY);

50   if lag(gvkey) ne gvkey or 93<datadate-lag(datadate) or datadate-lag(datadate)<0 or fqtr-lag(fqtr)

50 !  ne 1 then lagCAPXY=.;

51   if fqtr=1 then CAPXQ=CAPXY;

52   if fqtr=2 or fqtr=3 or fqtr=4 then CAPXQ=CAPXY-lagCAPXY;

53   CAPXQ_AT=CAPXQ/ATQ;

54   gvkey1 = gvkey*1;

55   run;



NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).

      54:10   

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 50:38       1 at 50:64       86 at 50:88      13800 at 52:47   15705 at 53:15

NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 45 variables.

NOTE: DATA statement used (Total process time):

      real time           0.04 seconds

      cpu time            0.03 seconds

      



56   

57   proc sort data = qcompustat; by cusip6 datadate descending atq; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 45 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.06 seconds

      cpu time            0.04 seconds

      



58   

59   proc sort data = qcompustat nodupkey; by cusip6 datadate; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 266 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 45 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.05 seconds

      cpu time            0.06 seconds

      



60   

61   proc sql;

62   create table googleesg as select *

63   from googleesg as a, qcompustat as b

64   where a.gvkey=b.gvkey1

65   and a.datadate=b.datadate

66   order by tic, news_date, date;

WARNING: Column named tic is duplicated in a select expression (or a view). Explicit references to it 

         will be to the first one.

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this 

         is a possible data integrity problem.

WARNING: Variable gvkey already exists on file WORK.GOOGLEESG.

WARNING: Variable datadate already exists on file WORK.GOOGLEESG.

WARNING: Variable tic already exists on file WORK.GOOGLEESG.

WARNING: Variable cusip6 already exists on file WORK.GOOGLEESG.

NOTE: Table WORK.GOOGLEESG created, with 84725 rows and 58 columns.



67   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.09 seconds

      cpu time            0.12 seconds

      



68   

69   data googleesg;

70   set googleesg;

71   if date>news_date then post=1;

72   else post=0;

73   ea=0;

74   if date-rdq>=0 & date-rdq<=3 then ea=1;

75   run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 74:8   

NOTE: There were 84725 observations read from the data set WORK.GOOGLEESG.

NOTE: The data set WORK.GOOGLEESG has 84725 observations and 60 variables.

NOTE: DATA statement used (Total process time):

      real time           0.02 seconds

      cpu time            0.03 seconds

      



76   

77   proc export data = googleesg

78   outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\google.dta"

79   dbms = '' replace;

80   run;



NOTE: The export data set has 84725 observations and 60 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\google.dta" file was 

      successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           0.06 seconds

      cpu time            0.04 seconds

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           25:21.04

      cpu time            7.40 seconds

      



===== 7_Aggrregate_ESG.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



2    

3    libname reprisk "F:\bdata\RepRisk";

NOTE: Libref REPRISK was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: F:\bdata\RepRisk

3  !                                     run;

4    libname data "H:\project\ESG News and Customer\Data";

NOTE: Libref DATA was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: H:\project\ESG News and Customer\Data

4  !                                                       run;

5    

6    /***********************A. Aggregate ESG and foot traffic*****************/

7    /**********1. Import and clean reprisk data********/

8    data rep;

9    set reprisk.repriskus2017_2020;

10   if index(related_countries,'United States of America') ge 1 then USnews=1;

11   if index(source_language,'English') ge 1 then news_english=1;

12   cusip6=substr(ISIN,3,6);

13   run;



NOTE: There were 6738982 observations read from the data set REPRISK.REPRISKUS2017_2020.

NOTE: The data set WORK.REP has 6738982 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           7:36.70

      cpu time            50.37 seconds

      



14   

15   /*dropping duplications*/

16   proc sort nodupkey data=rep out=rep2;

17   by cusip6 news_date reprisk_story_id;

18   run;



NOTE: There were 6738982 observations read from the data set WORK.REP.

NOTE: 6539055 observations with duplicate key values were deleted.

NOTE: The data set WORK.REP2 has 199927 observations and 18 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           22.38 seconds

      cpu time            19.92 seconds

      



19   

20   

21   data rep2;

22   set rep2;

23   newsyear = year(news_date);

24   newsmonth = month(news_date);

25   news = 1;

26   run;



NOTE: There were 199927 observations read from the data set WORK.REP2.

NOTE: The data set WORK.REP2 has 199927 observations and 21 variables.

NOTE: DATA statement used (Total process time):

      real time           1.27 seconds

      cpu time            1.15 seconds

      



27   

28   proc sort data = rep2;

29   by cusip6 newsyear newsmonth;

30   run;



NOTE: There were 199927 observations read from the data set WORK.REP2.

NOTE: The data set WORK.REP2 has 199927 observations and 21 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           2.92 seconds

      cpu time            3.98 seconds

      



31   

32   proc means data = rep2 noprint;

33   by cusip6 newsyear newsmonth;

34   var news;

35   output out = rep3(drop=_type_ _freq_) sum = news_sum;

36   run;



NOTE: There were 199927 observations read from the data set WORK.REP2.

NOTE: The data set WORK.REP3 has 74659 observations and 4 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           1.01 seconds

      cpu time            0.89 seconds

      



37   

38   data rep3;

39   set rep3;

40   if cusip6  = "" then delete;

41   run;



NOTE: There were 74659 observations read from the data set WORK.REP3.

NOTE: The data set WORK.REP3 has 74659 observations and 4 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



42   

43   data rep3;

44   set rep3;

45   if newsyear<2018 then delete;

46   if newsyear>2020 then delete;

47   run;



NOTE: There were 74659 observations read from the data set WORK.REP3.

NOTE: The data set WORK.REP3 has 55258 observations and 4 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



48   

49   /******2. Import safegraph foot traffic data*********/

50   data sg; set data.safegraph_fips_daily; run;

NOTE: Data file DATA.SAFEGRAPH_FIPS_DAILY.DATA is in a format that is native to another host, or the 

      file encoding does not match the session encoding. Cross Environment Data Access will be used, 

      which might require additional CPU resources and might reduce performance.



NOTE: There were 169944921 observations read from the data set DATA.SAFEGRAPH_FIPS_DAILY.

NOTE: The data set WORK.SG has 169944921 observations and 10 variables.

NOTE: DATA statement used (Total process time):

      real time           1:54.71

      cpu time            1:43.90

      



51   

52   proc freq data = sg; tables year; run;



NOTE: Writing HTML Body file: sashtml.htm

NOTE: There were 169944921 observations read from the data set WORK.SG.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           8.08 seconds

      cpu time            6.81 seconds

      



53   

54   data sg;

55   set sg;

56   if year > 2020 then delete;

57   keep stock_symbol fips totalvisits_day visitday year month;

58   run;



NOTE: There were 169944921 observations read from the data set WORK.SG.

NOTE: The data set WORK.SG has 145721444 observations and 6 variables.

NOTE: DATA statement used (Total process time):

      real time           13.54 seconds

      cpu time            11.43 seconds

      



59   

60   proc sort data = sg;

61   by stock_symbol fips year month;

62   run;



NOTE: There were 145721444 observations read from the data set WORK.SG.

NOTE: The data set WORK.SG has 145721444 observations and 6 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           35.36 seconds

      cpu time            1:09.28

      



63   

64   proc means data = sg noprint;

65   by stock_symbol fips year month;

66   var totalvisits_day;

67   output out = sg2(drop = _type_ _freq_) sum = visit;

68   run;



NOTE: There were 145721444 observations read from the data set WORK.SG.

NOTE: The data set WORK.SG2 has 4788698 observations and 5 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           21.80 seconds

      cpu time            20.25 seconds

      



69   

70   data sg2;

71   set sg2;

72   nfips = fips*1;

73   run;



NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).

      72:9   

NOTE: There were 4788698 observations read from the data set WORK.SG2.

NOTE: The data set WORK.SG2 has 4788698 observations and 6 variables.

NOTE: DATA statement used (Total process time):

      real time           0.44 seconds

      cpu time            0.39 seconds

      



74   

75   

76   /*******3. Import Compustsat**************/

77   data qcompustat;

78   set data.compustat_quarter;

79   if atq>0;

80   if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

81   MVEQ=(PRCCQ*CSHOQ);

82   MTBQ=MVEQ/CEQQ;

83   BTMQ=CEQQ/MVEQ;

84   lnMVEQ=log(MVEQ);

85   lnATQ=log(ATQ);

86   *LEVQ=(DLTTQ+DLCQ)/ATQ;

87   *LEV_MVEQ=(DLTTQ+DLCQ)/MVEQ;

88   Leverageq=LTQ/ATQ;

89   IBQ_ATQ=IBQ/ATQ;

90   if IBQ<0 and IBQ ne . then Loss=1;

91   if IBQ>=0 and IBQ ne . then Loss=0;

92   lnsaleq=log(1+saleq);

93   run;



NOTE: Invalid argument to function LOG(-0.198) at line 92 column 9.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ACMTA

cusip=004616207 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=30APR2020 atq=55.544 ceqq=28.126

cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639 lctq=. ltq=27.418 saleq=-1.198 seqq=28.126 teqq=28.126

txdbq=0 capxy=0.015 exchg=19 costat=A prccq=32.3 sic=6351 MVEQ=25.6462 MTBQ=0.9118324682

BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995 Leverageq=0.4936266743 IBQ_ATQ=-0.029508138

Loss=1 lnsaleq=. _ERROR_=1 _N_=243

NOTE: Invalid argument to function LOG(-0.091) at line 92 column 9.

gvkey=001790 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=AB.

cusip=043420108 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=26JUN2020 atq=29.565 ceqq=-20.591

cheq=2.976 chq=0.187 cshoq=2.837 ibq=-0.318 lctq=4.728 ltq=50.156 saleq=-1.091 seqq=-20.591

teqq=-20.591 txdbq=0.324 capxy=0.002 exchg=9 costat=A prccq=0.35 sic=6799 MVEQ=0.99295

MTBQ=-0.048222524 BTMQ=-20.73719724 lnMVEQ=-0.007074969 lnATQ=3.3865912293 Leverageq=1.6964654152

IBQ_ATQ=-0.010755961 Loss=1 lnsaleq=. _ERROR_=1 _N_=1691

NOTE: Invalid argument to function LOG(-9009) at line 92 column 9.

gvkey=002176 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=BRK.B

cusip=084670702 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=02MAY2020 atq=760448 ceqq=371565

cheq=144480 chq=42640 cshoq=2430.035 ibq=-49746 lctq=. ltq=385213 saleq=-9010 seqq=371565 teqq=375235

txdbq=. capxy=2968 exchg=11 costat=A prccq=182.83 sic=9997 MVEQ=444283.29905 MTBQ=1.1957081508

BTMQ=0.8363244821 lnMVEQ=13.004217699 lnATQ=13.541663012 Leverageq=0.5065606064 IBQ_ATQ=-0.065416702

Loss=1 lnsaleq=. _ERROR_=1 _N_=2441

NOTE: Invalid argument to function LOG(-4.5) at line 92 column 9.

gvkey=011729 datadate=31DEC2016 fyearq=2016 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2016Q4 datafqtr=2016Q4 rdq=07FEB2017 atq=6544.7 ceqq=3603.3

cheq=650.1 chq=149.8 cshoq=4.564 ibq=-46.9 lctq=. ltq=2807.5 saleq=-5.5 seqq=3603.3 teqq=3737.2

txdbq=0 capxy=4.3 exchg=11 costat=A prccq=836.05 sic=6351 MVEQ=3815.7322 MTBQ=1.0589549025

BTMQ=0.9443272775 lnMVEQ=8.2468878519 lnATQ=8.7864108408 Leverageq=0.4289730622 IBQ_ATQ=-0.007166104

Loss=1 lnsaleq=. _ERROR_=1 _N_=21894

NOTE: Invalid argument to function LOG(-69.6) at line 92 column 9.

gvkey=011729 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=3739.7 ceqq=3076.7

cheq=274 chq=136.4 cshoq=3.135 ibq=-129.7 lctq=. ltq=780.6 saleq=-70.6 seqq=3076.7 teqq=2959.1 txdbq=.

capxy=0 exchg=11 costat=A prccq=910 sic=6351 MVEQ=2852.85 MTBQ=0.9272434752 BTMQ=1.0784653943

lnMVEQ=7.9560737736 lnATQ=8.2267606733 Leverageq=0.2087333209 IBQ_ATQ=-0.034681926 Loss=1 lnsaleq=.

_ERROR_=1 _N_=21907

NOTE: Invalid argument to function LOG(-1.058) at line 92 column 9.

gvkey=011957 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=TOF.U

cusip=87725P105 curcdq=CAD datacqtr=2018Q2 datafqtr=2018Q2 rdq=20AUG2018 atq=14.763 ceqq=13.986

cheq=14.721 chq=0.261 cshoq=1.411 ibq=-2.336 lctq=0.777 ltq=0.777 saleq=-2.058 seqq=13.986 teqq=13.986

txdbq=0 capxy=0 exchg=7 costat=I prccq=10.97 sic=6199 MVEQ=15.47867 MTBQ=1.1067260117

BTMQ=0.9035660041 lnMVEQ=2.7394629472 lnATQ=2.6921240506 Leverageq=0.0526315789 IBQ_ATQ=-0.158233421

Loss=1 lnsaleq=. _ERROR_=1 _N_=22530

NOTE: Invalid argument to function LOG(-28) at line 92 column 9.

gvkey=013561 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MBI

cusip=55262C100 curcdq=USD datacqtr=2018Q2 datafqtr=2018Q2 rdq=08AUG2018 atq=8699 ceqq=1103 cheq=675

chq=197 cshoq=90.662 ibq=-146 lctq=. ltq=7584 saleq=-29 seqq=1103 teqq=1115 txdbq=0 capxy=0 exchg=11

costat=A prccq=9.04 sic=6351 MVEQ=819.58448 MTBQ=0.7430502992 BTMQ=1.3458039127 lnMVEQ=6.7087974801

lnATQ=9.0709633555 Leverageq=0.8718243476 IBQ_ATQ=-0.016783538 Loss=1 lnsaleq=. _ERROR_=1 _N_=26114

NOTE: Invalid argument to function LOG(-42) at line 92 column 9.

gvkey=013709 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=IEP

cusip=451100101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=24306 ceqq=3635 cheq=3257

chq=2381 cshoq=214.186 ibq=-1384 lctq=. ltq=14889 saleq=-43 seqq=3635 teqq=9417 txdbq=533 capxy=53

exchg=14 costat=A prccq=48.42 sic=9997 MVEQ=10370.88612 MTBQ=2.8530635818 BTMQ=0.3505004257

lnMVEQ=9.2467577479 lnATQ=10.098478512 Leverageq=0.6125647988 IBQ_ATQ=-0.056940673 Loss=1 lnsaleq=.

_ERROR_=1 _N_=26550

NOTE: Invalid argument to function LOG(-989) at line 92 column 9.

gvkey=014326 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ONEXF

cusip=68272K103 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=15MAY2020 atq=6184 ceqq=5904 cheq=813

chq=379 cshoq=99.159 ibq=-997 lctq=. ltq=280 saleq=-990 seqq=5904 teqq=5904 txdbq=. capxy=0 exchg=19

costat=A prccq=. sic=6799 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=. lnATQ=8.7297205903 Leverageq=0.0452781371

IBQ_ATQ=-0.16122251 Loss=1 lnsaleq=. _ERROR_=1 _N_=28182

NOTE: Invalid argument to function LOG(-98) at line 92 column 9.

gvkey=014824 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=CINF

cusip=172062101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=27APR2020 atq=23367 ceqq=8042 cheq=988

chq=486 cshoq=160.8 ibq=-1226 lctq=. ltq=15325 saleq=-99 seqq=8042 teqq=8042 txdbq=660 capxy=4

exchg=14 costat=A prccq=75.45 sic=6331 MVEQ=12132.36 MTBQ=1.5086247202 BTMQ=0.6628553719

lnMVEQ=9.403631542 lnATQ=10.05908005 Leverageq=0.6558394317 IBQ_ATQ=-0.052467155 Loss=1 lnsaleq=.

_ERROR_=1 _N_=30164

NOTE: Invalid argument to function LOG(-69.092) at line 92 column 9.

gvkey=015082 datadate=31MAR2016 fyearq=2016 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2016Q1 datafqtr=2016Q1 rdq=13MAY2016 atq=1870.033 ceqq=676.583

cheq=8.444 chq=7.986 cshoq=2.817 ibq=-54.83 lctq=. ltq=1125.576 saleq=-70.092 seqq=676.583

teqq=744.457 txdbq=13.752 capxy=0 exchg=19 costat=A prccq=125.77 sic=6799 MVEQ=354.29409

MTBQ=0.5236520723 BTMQ=1.909664934 lnMVEQ=5.870127331 lnATQ=7.5337113568 Leverageq=0.6019016777

IBQ_ATQ=-0.029320338 Loss=1 lnsaleq=. _ERROR_=1 _N_=31037

NOTE: Invalid argument to function LOG(-189.836) at line 92 column 9.

gvkey=015082 datadate=31DEC2018 fyearq=2018 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2018Q4 datafqtr=2018Q4 rdq=29MAR2019 atq=2756.97 ceqq=864.636

cheq=121.017 chq=120.555 cshoq=2.689 ibq=-152.197 lctq=. ltq=1787.549 saleq=-190.836 seqq=864.636

teqq=969.421 txdbq=25.782 capxy=0 exchg=19 costat=A prccq=161.01 sic=6799 MVEQ=432.95589

MTBQ=0.5007377555 BTMQ=1.9970533257 lnMVEQ=6.0706358521 lnATQ=7.9218875296 Leverageq=0.6483744836

IBQ_ATQ=-0.055204445 Loss=1 lnsaleq=. _ERROR_=1 _N_=31048

NOTE: Invalid argument to function LOG(-37.16) at line 92 column 9.

gvkey=015082 datadate=30JUN2019 fyearq=2019 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2019Q2 datafqtr=2019Q2 rdq=12AUG2019 atq=2548.264 ceqq=825.661

cheq=18.074 chq=17.609 cshoq=2.676 ibq=-56.555 lctq=. ltq=1704.613 saleq=-38.16 seqq=825.661

teqq=843.651 txdbq=22.483 capxy=0 exchg=19 costat=A prccq=168.61 sic=6799 MVEQ=451.20036

MTBQ=0.5464716875 BTMQ=1.829920969 lnMVEQ=6.1119114981 lnATQ=7.843167622 Leverageq=0.6689310841

IBQ_ATQ=-0.02219354 Loss=1 lnsaleq=. _ERROR_=1 _N_=31050

NOTE: Invalid argument to function LOG(-350.373) at line 92 column 9.

gvkey=015082 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=1980.88 ceqq=639.374

cheq=17.261 chq=16.796 cshoq=2.634 ibq=-341.993 lctq=. ltq=1325.132 saleq=-351.373 seqq=639.374

teqq=655.748 txdbq=25.959 capxy=0 exchg=19 costat=A prccq=109.99 sic=6799 MVEQ=289.71366

MTBQ=0.4531208025 BTMQ=2.2069169952 lnMVEQ=5.6688930559 lnATQ=7.5912964694 Leverageq=0.6689612697

IBQ_ATQ=-0.172647005 Loss=1 lnsaleq=. _ERROR_=1 _N_=31053

NOTE: Invalid argument to function LOG(-222.641) at line 92 column 9.

gvkey=015101 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MFA

cusip=55272X102 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=16JUN2020 atq=11130.337 ceqq=2440.485

cheq=333.367 chq=116.465 cshoq=453.138 ibq=-908.995 lctq=. ltq=8689.662 saleq=-223.641 seqq=2440.675

teqq=2440.675 txdbq=0 capxy=0 exchg=11 costat=A prccq=1.55 sic=6798 MVEQ=702.3639 MTBQ=0.2877968519

BTMQ=3.4746731716 lnMVEQ=6.5544516458 lnATQ=9.3174297223 Leverageq=0.780718679 IBQ_ATQ=-0.081668237

Loss=1 lnsaleq=. _ERROR_=1 _N_=31193

NOTE: Invalid argument to function LOG(-33.625) at line 92 column 9.

gvkey=015452 datadate=30JUN2016 fyearq=2016 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q2 datafqtr=2016Q2 rdq=05AUG2016 atq=17.55 ceqq=4.35

cheq=0.847 chq=0.847 cshoq=244.247 ibq=-35.485 lctq=13.2 ltq=13.2 saleq=-34.625 seqq=4.35 teqq=4.35

txdbq=0 capxy=0 exchg=19 costat=A prccq=0.072 sic=1311 MVEQ=17.585784 MTBQ=4.0427089655

BTMQ=0.2473588894 lnMVEQ=2.8670908484 lnATQ=2.8650539499 Leverageq=0.7521367521 IBQ_ATQ=-2.021937322

Loss=1 lnsaleq=. _ERROR_=1 _N_=32451

NOTE: Invalid argument to function LOG(-9.899) at line 92 column 9.

gvkey=015452 datadate=30SEP2016 fyearq=2016 fqtr=3 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q3 datafqtr=2016Q3 rdq=07NOV2016 atq=6.323 ceqq=-5.13

cheq=0.847 chq=0.847 cshoq=251.645 ibq=-10.927 lctq=11.453 ltq=11.453 saleq=-10.899 seqq=-5.13

teqq=-5.13 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.045 sic=1311 MVEQ=11.324025 MTBQ=-2.207412281

BTMQ=-0.453019134 lnMVEQ=2.4269265749 lnATQ=1.8441937791 Leverageq=1.8113237387 IBQ_ATQ=-1.728135379

Loss=1 lnsaleq=. _ERROR_=1 _N_=32452

NOTE: Invalid argument to function LOG(-4.947) at line 92 column 9.

gvkey=016187 datadate=31MAR2017 fyearq=2017 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2017Q1 datafqtr=2017Q1 rdq=04MAY2017 atq=3852.675 ceqq=806.124

cheq=1475.115 chq=115.677 cshoq=0.264 ibq=-17.725 lctq=. ltq=3046.551 saleq=-5.947 seqq=806.124

teqq=806.124 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=8.2565229912 Leverageq=0.7907625221 IBQ_ATQ=-0.0046007 Loss=1 lnsaleq=. _ERROR_=1 _N_=34057

NOTE: Invalid argument to function LOG(-2.939) at line 92 column 9.

gvkey=016187 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=06MAY2020 atq=1484.296 ceqq=667.972

cheq=909.717 chq=131.826 cshoq=0.264 ibq=-7.591 lctq=. ltq=816.324 saleq=-3.939 seqq=667.972

teqq=667.972 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=7.3026958648 Leverageq=0.5499738597 IBQ_ATQ=-0.005114209 Loss=1 lnsaleq=. _ERROR_=1 _N_=34069

NOTE: Invalid argument to function LOG(-1956) at line 92 column 9.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=016384 datadate=31MAR2021 fyearq=2021 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=VOYA

cusip=929089100 curcdq=USD datacqtr=2021Q1 datafqtr=2021Q1 rdq=10MAY2021 atq=162861 ceqq=7931

cheq=3182 chq=1316 cshoq=121.222 ibq=1086 lctq=. ltq=153862 saleq=-1957 seqq=7931 teqq=8999 txdbq=0

capxy=0 exchg=11 costat=A prccq=63.64 sic=6311 MVEQ=7714.56808 MTBQ=0.9727106393 BTMQ=1.0280549627

lnMVEQ=8.9508657788 lnATQ=12.000652355 Leverageq=0.9447442911 IBQ_ATQ=0.0066682631 Loss=0 lnsaleq=.

_ERROR_=1 _N_=34258

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      12941 at 81:12   13505 at 82:10   13505 at 83:10   12941 at 84:8    155 at 88:14

      624 at 89:12     1478 at 92:9     1478 at 92:14    

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 82:10   1 at 83:10    1 at 84:8     243 at 92:9   

NOTE: There were 251509 observations read from the data set DATA.COMPUSTAT_QUARTER.

NOTE: The data set WORK.QCOMPUSTAT has 167464 observations and 40 variables.

NOTE: DATA statement used (Total process time):

      real time           0.22 seconds

      cpu time            0.07 seconds

      



94   

95   proc sort nodupkey data=qcompustat; by gvkey datadate; run;



NOTE: There were 167464 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 93 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 40 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.13 seconds

      cpu time            0.11 seconds

      



96   

97   data qcompustat;

98   set qcompustat;

99   cusip6=substr(cusip,1,6);

100  lagCAPXY=lag(CAPXY);

101  if lag(gvkey) ne gvkey or 93<datadate-lag(datadate) or datadate-lag(datadate)<0 or fqtr-lag(fqtr)

101!  ne 1 then lagCAPXY=.;

102  if fqtr=1 then CAPXQ=CAPXY;

103  if fqtr=2 or fqtr=3 or fqtr=4 then CAPXQ=CAPXY-lagCAPXY;

104  CAPXQ_AT=CAPXQ/ATQ;

105  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 101:38       1 at 101:64       86 at 101:88      13800 at 103:47   15705 at 104:15

NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: DATA statement used (Total process time):

      real time           0.07 seconds

      cpu time            0.06 seconds

      



106  

107  proc sort data = qcompustat; by cusip6 datadate descending atq; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.13 seconds

      cpu time            0.14 seconds

      



108  

109  proc sort data = qcompustat nodupkey; by cusip6 datadate; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 266 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.14 seconds

      cpu time            0.17 seconds

      



110  

111  

112  /*************4. Merge Reprisk and Compustat***********/

113  

114  /****4.1 Fill in zero ESG news month*****/

115  data rep3;

116  set rep3;

117  format newsdate yymmdds10.;

118  newsdate = mdy(newsmonth, 1, newsyear);

119  newsdate = intnx('month', newsdate, 0, 'end');

120  run;



NOTE: There were 55258 observations read from the data set WORK.REP3.

NOTE: The data set WORK.REP3 has 55258 observations and 5 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.04 seconds

      



121  

122  proc sort data = rep3 nodupkey out = firm; by cusip6; run;



NOTE: There were 55258 observations read from the data set WORK.REP3.

NOTE: 48786 observations with duplicate key values were deleted.

NOTE: The data set WORK.FIRM has 6472 observations and 5 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



123  

124  data firm;

125  set firm;

126  keep cusip6;

127  run;



NOTE: There were 6472 observations read from the data set WORK.FIRM.

NOTE: The data set WORK.FIRM has 6472 observations and 1 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



128  

129  proc sort data = rep3 nodupkey out = date; by newsdate; run;



NOTE: There were 55258 observations read from the data set WORK.REP3.

NOTE: 55222 observations with duplicate key values were deleted.

NOTE: The data set WORK.DATE has 36 observations and 5 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.00 seconds

      



130  

131  data date;

132  set date;

133  keep newsdate;

134  run;



NOTE: There were 36 observations read from the data set WORK.DATE.

NOTE: The data set WORK.DATE has 36 observations and 1 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



135  

136  proc sql;

137  create table rep4 as select *

138  from firm as a, date as b

139  order by cusip6, newsdate;

NOTE: The execution of this query involves performing one or more Cartesian product joins that can 

      not be optimized.

NOTE: Table WORK.REP4 created, with 232992 rows and 2 columns.



140  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.08 seconds

      cpu time            0.10 seconds

      



141  

142  proc sql;

143  create table rep4 as select *

144  from rep4 as a left join rep3 as b

145  on a.cusip6 = b.cusip6

146  and a.newsdate = b.newsdate

147  order by cusip6, newsdate;

WARNING: Column named cusip6 is duplicated in a select expression (or a view). Explicit references to 

         it will be to the first one.

WARNING: Column named newsdate is duplicated in a select expression (or a view). Explicit references 

         to it will be to the first one.

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this 

         is a possible data integrity problem.

WARNING: Variable cusip6 already exists on file WORK.REP4.

WARNING: Variable newsdate already exists on file WORK.REP4.

NOTE: Table WORK.REP4 created, with 232992 rows and 5 columns.



148  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.05 seconds

      cpu time            0.04 seconds

      



149  

150  data rep4;

151  set rep4;

152  if news_sum = . then news_sum = 0;

153  run;



NOTE: There were 232992 observations read from the data set WORK.REP4.

NOTE: The data set WORK.REP4 has 232992 observations and 5 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



154  

155  /****4.2 Merge with Compustat*****/

156  proc sql;

157  create table rep5 as

158  select a.*, b.*

159  from rep4 as a, qcompustat as b

160  where (a.cusip6 = b.cusip6) and (a.newsdate-93)<b.datadate<a.newsdate

161  order by a.cusip6, a.newsdate;

WARNING: Variable cusip6 already exists on file WORK.REP5.

NOTE: Table WORK.REP5 created, with 72277 rows and 48 columns.



162  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.21 seconds

      cpu time            0.18 seconds

      



163  

164  proc sort data = rep5; by cusip6 newsdate descending datadate; run;



NOTE: There were 72277 observations read from the data set WORK.REP5.

NOTE: The data set WORK.REP5 has 72277 observations and 48 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.04 seconds

      cpu time            0.04 seconds

      



165  

166  proc sort data = rep5 nodupkey; by cusip6 newsdate; run;



NOTE: There were 72277 observations read from the data set WORK.REP5.

NOTE: 0 observations with duplicate key values were deleted.

NOTE: The data set WORK.REP5 has 72277 observations and 48 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.04 seconds

      cpu time            0.04 seconds

      



167  

168  /****5. Merge reprisk with foot traffic, current month and next month****/

169  data sg2;

170  set sg2;

171  format date yymmdds10.;

172  date = mdy(month, 1, year);

173  date = intnx('month', date, 0, 'end');

174  run;



NOTE: There were 4788698 observations read from the data set WORK.SG2.

NOTE: The data set WORK.SG2 has 4788698 observations and 7 variables.

NOTE: DATA statement used (Total process time):

      real time           1.66 seconds

      cpu time            1.42 seconds

      



175  

176  proc sql;

177  create table sg3_1 as select *

178  from rep5 as a, sg2 as b

179  where a.tic = b.stock_symbol

180  and a.newsdate = b.date

181  order by tic, nfips, date;

NOTE: Table WORK.SG3_1 created, with 3374174 rows and 55 columns.



182  

183  create table sg3_2 as select

184  a.*, b.visit as visit_f1, b.nfips, b.date as date_f1

185  from rep5 as a, sg2 as b

186  where a.tic = b.stock_symbol

187  and intnx('month', a.newsdate, 1, 'end') = b.date

188  order by tic, nfips, newsdate;

NOTE: Table WORK.SG3_2 created, with 3270805 rows and 51 columns.



189  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           5.96 seconds

      cpu time            9.06 seconds

      



190  

191  data sg3;

192  merge sg3_1 sg3_2;

193  by tic nfips newsdate;

194  run;



NOTE: There were 3374174 observations read from the data set WORK.SG3_1.

NOTE: There were 3270805 observations read from the data set WORK.SG3_2.

NOTE: The data set WORK.SG3 has 3688374 observations and 57 variables.

NOTE: DATA statement used (Total process time):

      real time           2.34 seconds

      cpu time            2.26 seconds

      



195  

196  data sg3;

197  set sg3;

198  if nfips = 9 then delete;

199  logesg = log(1+news_sum);

200  logvisit = log(1+visit);

201  logvisit_f1 = log(1+visit_f1);

202  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      313176 at 200:12   313176 at 200:17   416558 at 201:15   416558 at 201:20   

NOTE: There were 3688374 observations read from the data set WORK.SG3.

NOTE: The data set WORK.SG3 has 3680081 observations and 60 variables.

NOTE: DATA statement used (Total process time):

      real time           1.81 seconds

      cpu time            1.65 seconds

      



203  

204  

205  

206  

207  /****6.  indicate if the firm is in the sample*****/

208  proc import out = tic

209  datafile = "H:\project\ESG News and Customer\Data\ticnewsdate1013.dta"

210  dbms = '' replace;

211  run;



NOTE: One or more variables were converted because the data type is not supported by the V9 engine. 

      For more details, run with options MSGLEVEL=I.

NOTE: The import data set has 2735 observations and 13 variables.

NOTE: WORK.TIC data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.04 seconds

      cpu time            0.03 seconds

      



212  

213  

214  proc sort data = tic nodupkey out = gvkey; by gvkey; run;



NOTE: There were 2735 observations read from the data set WORK.TIC.

NOTE: 2484 observations with duplicate key values were deleted.

NOTE: The data set WORK.GVKEY has 251 observations and 13 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



215  

216  data gvkey;

217  set gvkey;

218  keep gvkey1 insample;

219  insample = 1;

220  gvkey1 = put(gvkey, z6.);

221  run;



NOTE: There were 251 observations read from the data set WORK.GVKEY.

NOTE: The data set WORK.GVKEY has 251 observations and 2 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



222  

223  

224  proc sql;

225  create table sg3 as select

226  a.*, b.insample

227  from sg3 as a left join gvkey as b

228  on a.gvkey = b.gvkey1

229  order by tic, nfips, newsdate;

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this 

         is a possible data integrity problem.

NOTE: Table WORK.SG3 created, with 3680081 rows and 61 columns.



230  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           6.94 seconds

      cpu time            10.75 seconds

      



231  

232  data sg3;

233  set sg3;

234  if insample = . then insample = 0;

235  run;



NOTE: There were 3680081 observations read from the data set WORK.SG3.

NOTE: The data set WORK.SG3 has 3680081 observations and 61 variables.

NOTE: DATA statement used (Total process time):

      real time           1.58 seconds

      cpu time            1.59 seconds

      



236  

237  

238  proc export data = sg3

239  outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\month_esg_ft.dta"

240  dbms = '' replace;

241  run;



NOTE: The export data set has 3680081 observations and 61 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\month_esg_ft.dta" file was 

      successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           3.45 seconds

      cpu time            3.07 seconds

      



242  

243  

244  

245  

246  

247  /**********************B. quarterly ESG and quarterly sales************/

248  /**********1. Import and clean reprisk data********/

249  data rep;

250  set reprisk.repriskus2017_2020;

251  if index(related_countries,'United States of America') ge 1 then USnews=1;

252  if index(source_language,'English') ge 1 then news_english=1;

253  cusip6=substr(ISIN,3,6);

254  run;



NOTE: There were 6738982 observations read from the data set REPRISK.REPRISKUS2017_2020.

NOTE: The data set WORK.REP has 6738982 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           7:36.93

      cpu time            1:26.79

      



255  

256  /*dropping duplications*/

257  proc sort nodupkey data=rep out=rep2;

258  by cusip6 news_date reprisk_story_id;

259  run;



NOTE: There were 6738982 observations read from the data set WORK.REP.

NOTE: 6539055 observations with duplicate key values were deleted.

NOTE: The data set WORK.REP2 has 199927 observations and 18 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           20.75 seconds

      cpu time            17.50 seconds

      



260  

261  data rep2;

262  set rep2;

263  newsyear = year(news_date);

264  newsmonth = month(news_date);

265  news = 1;

266  run;



NOTE: There were 199927 observations read from the data set WORK.REP2.

NOTE: The data set WORK.REP2 has 199927 observations and 21 variables.

NOTE: DATA statement used (Total process time):

      real time           1.14 seconds

      cpu time            1.14 seconds

      



267  

268  proc sort data = rep2;

269  by cusip6 newsyear newsmonth;

270  run;



NOTE: There were 199927 observations read from the data set WORK.REP2.

NOTE: The data set WORK.REP2 has 199927 observations and 21 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           3.23 seconds

      cpu time            4.07 seconds

      



271  

272  data rep3;

273  set rep2;

274  keep cusip6  news_date news;

275  if cusip6 = "" then delete;

276  run;



NOTE: There were 199927 observations read from the data set WORK.REP2.

NOTE: The data set WORK.REP3 has 199927 observations and 3 variables.

NOTE: DATA statement used (Total process time):

      real time           0.91 seconds

      cpu time            0.85 seconds

      



277  

278  /*******2. Import Compustsat**************/

279  data qcompustat;

280  set data.compustat_quarter;

281  if atq>0;

282  if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

283  MVEQ=(PRCCQ*CSHOQ);

284  MTBQ=MVEQ/CEQQ;

285  BTMQ=CEQQ/MVEQ;

286  lnMVEQ=log(MVEQ);

287  lnATQ=log(ATQ);

288  *LEVQ=(DLTTQ+DLCQ)/ATQ;

289  *LEV_MVEQ=(DLTTQ+DLCQ)/MVEQ;

290  Leverageq=LTQ/ATQ;

291  IBQ_ATQ=IBQ/ATQ;

292  if IBQ<0 and IBQ ne . then Loss=1;

293  if IBQ>=0 and IBQ ne . then Loss=0;

294  lnsaleq=log(1+saleq);

295  run;



NOTE: Invalid argument to function LOG(-0.198) at line 294 column 9.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ACMTA

cusip=004616207 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=30APR2020 atq=55.544 ceqq=28.126

cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639 lctq=. ltq=27.418 saleq=-1.198 seqq=28.126 teqq=28.126

txdbq=0 capxy=0.015 exchg=19 costat=A prccq=32.3 sic=6351 MVEQ=25.6462 MTBQ=0.9118324682

BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995 Leverageq=0.4936266743 IBQ_ATQ=-0.029508138

Loss=1 lnsaleq=. _ERROR_=1 _N_=243

NOTE: Invalid argument to function LOG(-0.091) at line 294 column 9.

gvkey=001790 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=AB.

cusip=043420108 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=26JUN2020 atq=29.565 ceqq=-20.591

cheq=2.976 chq=0.187 cshoq=2.837 ibq=-0.318 lctq=4.728 ltq=50.156 saleq=-1.091 seqq=-20.591

teqq=-20.591 txdbq=0.324 capxy=0.002 exchg=9 costat=A prccq=0.35 sic=6799 MVEQ=0.99295

MTBQ=-0.048222524 BTMQ=-20.73719724 lnMVEQ=-0.007074969 lnATQ=3.3865912293 Leverageq=1.6964654152

IBQ_ATQ=-0.010755961 Loss=1 lnsaleq=. _ERROR_=1 _N_=1691

NOTE: Invalid argument to function LOG(-9009) at line 294 column 9.

gvkey=002176 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=BRK.B

cusip=084670702 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=02MAY2020 atq=760448 ceqq=371565

cheq=144480 chq=42640 cshoq=2430.035 ibq=-49746 lctq=. ltq=385213 saleq=-9010 seqq=371565 teqq=375235

txdbq=. capxy=2968 exchg=11 costat=A prccq=182.83 sic=9997 MVEQ=444283.29905 MTBQ=1.1957081508

BTMQ=0.8363244821 lnMVEQ=13.004217699 lnATQ=13.541663012 Leverageq=0.5065606064 IBQ_ATQ=-0.065416702

Loss=1 lnsaleq=. _ERROR_=1 _N_=2441

NOTE: Invalid argument to function LOG(-4.5) at line 294 column 9.

gvkey=011729 datadate=31DEC2016 fyearq=2016 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2016Q4 datafqtr=2016Q4 rdq=07FEB2017 atq=6544.7 ceqq=3603.3

cheq=650.1 chq=149.8 cshoq=4.564 ibq=-46.9 lctq=. ltq=2807.5 saleq=-5.5 seqq=3603.3 teqq=3737.2

txdbq=0 capxy=4.3 exchg=11 costat=A prccq=836.05 sic=6351 MVEQ=3815.7322 MTBQ=1.0589549025

BTMQ=0.9443272775 lnMVEQ=8.2468878519 lnATQ=8.7864108408 Leverageq=0.4289730622 IBQ_ATQ=-0.007166104

Loss=1 lnsaleq=. _ERROR_=1 _N_=21894

NOTE: Invalid argument to function LOG(-69.6) at line 294 column 9.

gvkey=011729 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=WTM

cusip=G9618E107 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=3739.7 ceqq=3076.7

cheq=274 chq=136.4 cshoq=3.135 ibq=-129.7 lctq=. ltq=780.6 saleq=-70.6 seqq=3076.7 teqq=2959.1 txdbq=.

capxy=0 exchg=11 costat=A prccq=910 sic=6351 MVEQ=2852.85 MTBQ=0.9272434752 BTMQ=1.0784653943

lnMVEQ=7.9560737736 lnATQ=8.2267606733 Leverageq=0.2087333209 IBQ_ATQ=-0.034681926 Loss=1 lnsaleq=.

_ERROR_=1 _N_=21907

NOTE: Invalid argument to function LOG(-1.058) at line 294 column 9.

gvkey=011957 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=TOF.U

cusip=87725P105 curcdq=CAD datacqtr=2018Q2 datafqtr=2018Q2 rdq=20AUG2018 atq=14.763 ceqq=13.986

cheq=14.721 chq=0.261 cshoq=1.411 ibq=-2.336 lctq=0.777 ltq=0.777 saleq=-2.058 seqq=13.986 teqq=13.986

txdbq=0 capxy=0 exchg=7 costat=I prccq=10.97 sic=6199 MVEQ=15.47867 MTBQ=1.1067260117

BTMQ=0.9035660041 lnMVEQ=2.7394629472 lnATQ=2.6921240506 Leverageq=0.0526315789 IBQ_ATQ=-0.158233421

Loss=1 lnsaleq=. _ERROR_=1 _N_=22530

NOTE: Invalid argument to function LOG(-28) at line 294 column 9.

gvkey=013561 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MBI

cusip=55262C100 curcdq=USD datacqtr=2018Q2 datafqtr=2018Q2 rdq=08AUG2018 atq=8699 ceqq=1103 cheq=675

chq=197 cshoq=90.662 ibq=-146 lctq=. ltq=7584 saleq=-29 seqq=1103 teqq=1115 txdbq=0 capxy=0 exchg=11

costat=A prccq=9.04 sic=6351 MVEQ=819.58448 MTBQ=0.7430502992 BTMQ=1.3458039127 lnMVEQ=6.7087974801

lnATQ=9.0709633555 Leverageq=0.8718243476 IBQ_ATQ=-0.016783538 Loss=1 lnsaleq=. _ERROR_=1 _N_=26114

NOTE: Invalid argument to function LOG(-42) at line 294 column 9.

gvkey=013709 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=IEP

cusip=451100101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=24306 ceqq=3635 cheq=3257

chq=2381 cshoq=214.186 ibq=-1384 lctq=. ltq=14889 saleq=-43 seqq=3635 teqq=9417 txdbq=533 capxy=53

exchg=14 costat=A prccq=48.42 sic=9997 MVEQ=10370.88612 MTBQ=2.8530635818 BTMQ=0.3505004257

lnMVEQ=9.2467577479 lnATQ=10.098478512 Leverageq=0.6125647988 IBQ_ATQ=-0.056940673 Loss=1 lnsaleq=.

_ERROR_=1 _N_=26550

NOTE: Invalid argument to function LOG(-989) at line 294 column 9.

gvkey=014326 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=ONEXF

cusip=68272K103 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=15MAY2020 atq=6184 ceqq=5904 cheq=813

chq=379 cshoq=99.159 ibq=-997 lctq=. ltq=280 saleq=-990 seqq=5904 teqq=5904 txdbq=. capxy=0 exchg=19

costat=A prccq=. sic=6799 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=. lnATQ=8.7297205903 Leverageq=0.0452781371

IBQ_ATQ=-0.16122251 Loss=1 lnsaleq=. _ERROR_=1 _N_=28182

NOTE: Invalid argument to function LOG(-98) at line 294 column 9.

gvkey=014824 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=CINF

cusip=172062101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=27APR2020 atq=23367 ceqq=8042 cheq=988

chq=486 cshoq=160.8 ibq=-1226 lctq=. ltq=15325 saleq=-99 seqq=8042 teqq=8042 txdbq=660 capxy=4

exchg=14 costat=A prccq=75.45 sic=6331 MVEQ=12132.36 MTBQ=1.5086247202 BTMQ=0.6628553719

lnMVEQ=9.403631542 lnATQ=10.05908005 Leverageq=0.6558394317 IBQ_ATQ=-0.052467155 Loss=1 lnsaleq=.

_ERROR_=1 _N_=30164

NOTE: Invalid argument to function LOG(-69.092) at line 294 column 9.

gvkey=015082 datadate=31MAR2016 fyearq=2016 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2016Q1 datafqtr=2016Q1 rdq=13MAY2016 atq=1870.033 ceqq=676.583

cheq=8.444 chq=7.986 cshoq=2.817 ibq=-54.83 lctq=. ltq=1125.576 saleq=-70.092 seqq=676.583

teqq=744.457 txdbq=13.752 capxy=0 exchg=19 costat=A prccq=125.77 sic=6799 MVEQ=354.29409

MTBQ=0.5236520723 BTMQ=1.909664934 lnMVEQ=5.870127331 lnATQ=7.5337113568 Leverageq=0.6019016777

IBQ_ATQ=-0.029320338 Loss=1 lnsaleq=. _ERROR_=1 _N_=31037

NOTE: Invalid argument to function LOG(-189.836) at line 294 column 9.

gvkey=015082 datadate=31DEC2018 fyearq=2018 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2018Q4 datafqtr=2018Q4 rdq=29MAR2019 atq=2756.97 ceqq=864.636

cheq=121.017 chq=120.555 cshoq=2.689 ibq=-152.197 lctq=. ltq=1787.549 saleq=-190.836 seqq=864.636

teqq=969.421 txdbq=25.782 capxy=0 exchg=19 costat=A prccq=161.01 sic=6799 MVEQ=432.95589

MTBQ=0.5007377555 BTMQ=1.9970533257 lnMVEQ=6.0706358521 lnATQ=7.9218875296 Leverageq=0.6483744836

IBQ_ATQ=-0.055204445 Loss=1 lnsaleq=. _ERROR_=1 _N_=31048

NOTE: Invalid argument to function LOG(-37.16) at line 294 column 9.

gvkey=015082 datadate=30JUN2019 fyearq=2019 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2019Q2 datafqtr=2019Q2 rdq=12AUG2019 atq=2548.264 ceqq=825.661

cheq=18.074 chq=17.609 cshoq=2.676 ibq=-56.555 lctq=. ltq=1704.613 saleq=-38.16 seqq=825.661

teqq=843.651 txdbq=22.483 capxy=0 exchg=19 costat=A prccq=168.61 sic=6799 MVEQ=451.20036

MTBQ=0.5464716875 BTMQ=1.829920969 lnMVEQ=6.1119114981 lnATQ=7.843167622 Leverageq=0.6689310841

IBQ_ATQ=-0.02219354 Loss=1 lnsaleq=. _ERROR_=1 _N_=31050

NOTE: Invalid argument to function LOG(-350.373) at line 294 column 9.

gvkey=015082 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=SVCTF

cusip=81731L109 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=1980.88 ceqq=639.374

cheq=17.261 chq=16.796 cshoq=2.634 ibq=-341.993 lctq=. ltq=1325.132 saleq=-351.373 seqq=639.374

teqq=655.748 txdbq=25.959 capxy=0 exchg=19 costat=A prccq=109.99 sic=6799 MVEQ=289.71366

MTBQ=0.4531208025 BTMQ=2.2069169952 lnMVEQ=5.6688930559 lnATQ=7.5912964694 Leverageq=0.6689612697

IBQ_ATQ=-0.172647005 Loss=1 lnsaleq=. _ERROR_=1 _N_=31053

NOTE: Invalid argument to function LOG(-222.641) at line 294 column 9.

gvkey=015101 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=MFA

cusip=55272X102 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=16JUN2020 atq=11130.337 ceqq=2440.485

cheq=333.367 chq=116.465 cshoq=453.138 ibq=-908.995 lctq=. ltq=8689.662 saleq=-223.641 seqq=2440.675

teqq=2440.675 txdbq=0 capxy=0 exchg=11 costat=A prccq=1.55 sic=6798 MVEQ=702.3639 MTBQ=0.2877968519

BTMQ=3.4746731716 lnMVEQ=6.5544516458 lnATQ=9.3174297223 Leverageq=0.780718679 IBQ_ATQ=-0.081668237

Loss=1 lnsaleq=. _ERROR_=1 _N_=31193

NOTE: Invalid argument to function LOG(-33.625) at line 294 column 9.

gvkey=015452 datadate=30JUN2016 fyearq=2016 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q2 datafqtr=2016Q2 rdq=05AUG2016 atq=17.55 ceqq=4.35

cheq=0.847 chq=0.847 cshoq=244.247 ibq=-35.485 lctq=13.2 ltq=13.2 saleq=-34.625 seqq=4.35 teqq=4.35

txdbq=0 capxy=0 exchg=19 costat=A prccq=0.072 sic=1311 MVEQ=17.585784 MTBQ=4.0427089655

BTMQ=0.2473588894 lnMVEQ=2.8670908484 lnATQ=2.8650539499 Leverageq=0.7521367521 IBQ_ATQ=-2.021937322

Loss=1 lnsaleq=. _ERROR_=1 _N_=32451

NOTE: Invalid argument to function LOG(-9.899) at line 294 column 9.

gvkey=015452 datadate=30SEP2016 fyearq=2016 fqtr=3 indfmt=INDL consol=C popsrc=D datafmt=STD tic=LNCOQ

cusip=535782106 curcdq=USD datacqtr=2016Q3 datafqtr=2016Q3 rdq=07NOV2016 atq=6.323 ceqq=-5.13

cheq=0.847 chq=0.847 cshoq=251.645 ibq=-10.927 lctq=11.453 ltq=11.453 saleq=-10.899 seqq=-5.13

teqq=-5.13 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.045 sic=1311 MVEQ=11.324025 MTBQ=-2.207412281

BTMQ=-0.453019134 lnMVEQ=2.4269265749 lnATQ=1.8441937791 Leverageq=1.8113237387 IBQ_ATQ=-1.728135379

Loss=1 lnsaleq=. _ERROR_=1 _N_=32452

NOTE: Invalid argument to function LOG(-4.947) at line 294 column 9.

gvkey=016187 datadate=31MAR2017 fyearq=2017 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2017Q1 datafqtr=2017Q1 rdq=04MAY2017 atq=3852.675 ceqq=806.124

cheq=1475.115 chq=115.677 cshoq=0.264 ibq=-17.725 lctq=. ltq=3046.551 saleq=-5.947 seqq=806.124

teqq=806.124 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=8.2565229912 Leverageq=0.7907625221 IBQ_ATQ=-0.0046007 Loss=1 lnsaleq=. _ERROR_=1 _N_=34057

NOTE: Invalid argument to function LOG(-2.939) at line 294 column 9.

gvkey=016187 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=6120B

cusip=282645936 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=06MAY2020 atq=1484.296 ceqq=667.972

cheq=909.717 chq=131.826 cshoq=0.264 ibq=-7.591 lctq=. ltq=816.324 saleq=-3.939 seqq=667.972

teqq=667.972 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=7.3026958648 Leverageq=0.5499738597 IBQ_ATQ=-0.005114209 Loss=1 lnsaleq=. _ERROR_=1 _N_=34069

NOTE: Invalid argument to function LOG(-1956) at line 294 column 9.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=016384 datadate=31MAR2021 fyearq=2021 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD tic=VOYA

cusip=929089100 curcdq=USD datacqtr=2021Q1 datafqtr=2021Q1 rdq=10MAY2021 atq=162861 ceqq=7931

cheq=3182 chq=1316 cshoq=121.222 ibq=1086 lctq=. ltq=153862 saleq=-1957 seqq=7931 teqq=8999 txdbq=0

capxy=0 exchg=11 costat=A prccq=63.64 sic=6311 MVEQ=7714.56808 MTBQ=0.9727106393 BTMQ=1.0280549627

lnMVEQ=8.9508657788 lnATQ=12.000652355 Leverageq=0.9447442911 IBQ_ATQ=0.0066682631 Loss=0 lnsaleq=.

_ERROR_=1 _N_=34258

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      12941 at 283:12   13505 at 284:10   13505 at 285:10   12941 at 286:8    155 at 290:14

      624 at 291:12     1478 at 294:9     1478 at 294:14    

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 284:10   1 at 285:10    1 at 286:8     243 at 294:9   

NOTE: There were 251509 observations read from the data set DATA.COMPUSTAT_QUARTER.

NOTE: The data set WORK.QCOMPUSTAT has 167464 observations and 40 variables.

NOTE: DATA statement used (Total process time):

      real time           0.23 seconds

      cpu time            0.06 seconds

      



296  

297  proc sort nodupkey data=qcompustat; by gvkey datadate; run;



NOTE: There were 167464 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 93 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 40 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.12 seconds

      cpu time            0.09 seconds

      



298  

299  data qcompustat;

300  set qcompustat;

301  cusip6=substr(cusip,1,6);

302  lagCAPXY=lag(CAPXY);

303  if lag(gvkey) ne gvkey or 93<datadate-lag(datadate) or datadate-lag(datadate)<0 or fqtr-lag(fqtr)

303!  ne 1 then lagCAPXY=.;

304  if fqtr=1 then CAPXQ=CAPXY;

305  if fqtr=2 or fqtr=3 or fqtr=4 then CAPXQ=CAPXY-lagCAPXY;

306  CAPXQ_AT=CAPXQ/ATQ;

307  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 303:38       1 at 303:64       86 at 303:88      13800 at 305:47   15705 at 306:15

NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: DATA statement used (Total process time):

      real time           0.07 seconds

      cpu time            0.07 seconds

      



308  

309  proc sort data = qcompustat; by cusip6 datadate descending atq; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.14 seconds

      cpu time            0.15 seconds

      



310  

311  proc sort data = qcompustat nodupkey; by cusip6 datadate; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 266 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.14 seconds

      cpu time            0.17 seconds

      



312  

313  data qcomp;

314  set qcompustat;

315  keep cusip6 datadate;

316  run;



NOTE: There were 167105 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMP has 167105 observations and 2 variables.

NOTE: DATA statement used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



317  

318  proc sort data = qcomp nodupkey;

319  by cusip6 datadate;

320  run;



NOTE: There were 167105 observations read from the data set WORK.QCOMP.

NOTE: 0 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMP has 167105 observations and 2 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.04 seconds

      cpu time            0.06 seconds

      



321  

322  data qcomp;

323  set qcomp;

324  format lagdatadate yymmdds10.;

325  lagdatadate = intnx('quarter', datadate, -1, 'end');

326  run;



NOTE: There were 167105 observations read from the data set WORK.QCOMP.

NOTE: The data set WORK.QCOMP has 167105 observations and 3 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



327  

328  /****3. Merge, calculate quarterly ESG news***/

329  proc sql;

330  create table rep3 as select *

331  from rep3 as a, qcomp as b

332  where a.cusip6 = b.cusip6

333  and a.news_date > b.lagdatadate

334  and a.news_date <= b.datadate

335  order by cusip6, datadate;

WARNING: Column named cusip6 is duplicated in a select expression (or a view). Explicit references to 

         it will be to the first one.

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this 

         is a possible data integrity problem.

WARNING: Variable cusip6 already exists on file WORK.REP3.

NOTE: Table WORK.REP3 created, with 50221 rows and 5 columns.



336  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.11 seconds

      cpu time            0.10 seconds

      



337  

338  proc means data = rep3 noprint;

339  by cusip6 datadate;

340  var news;

341  output out = rep4 (drop=_type_ _freq_) sum =;

342  run;



NOTE: There were 50221 observations read from the data set WORK.REP3.

NOTE: The data set WORK.REP4 has 11841 observations and 3 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.01 seconds

      cpu time            0.03 seconds

      



343  

344  

345  /**********4. Merge with sales compustat******/

346  

347  data qcompustat;

348  set qcompustat;

349  format lagdatadate yymmdds10.;

350  drop indfmt--datafmt curcdq exchg costat;

351  lagdatadate = intnx('quarter', datadate, -1, 'end');

352  run;



NOTE: There were 167105 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 38 variables.

NOTE: DATA statement used (Total process time):

      real time           0.11 seconds

      cpu time            0.07 seconds

      



353  

354  /*current quarter*/

355  

356  proc sql;

357  create table rep5 as select *

358  from qcompustat as a left join rep4 as b

359  on a.cusip6 = b.cusip6

360  and a.datadate = b.datadate

361  order by cusip6, datadate;

WARNING: Column named cusip6 is duplicated in a select expression (or a view). Explicit references to 

         it will be to the first one.

WARNING: Column named datadate is duplicated in a select expression (or a view). Explicit references 

         to it will be to the first one.

WARNING: Variable cusip6 already exists on file WORK.REP5.

WARNING: Variable datadate already exists on file WORK.REP5.

NOTE: Table WORK.REP5 created, with 167105 rows and 39 columns.



362  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.22 seconds

      cpu time            0.23 seconds

      



363  

364  

365  data rep5;

366  set rep5;

367  if news = . then news = 0;

368  logesg = log(1+news);

369  logsale = log(1+saleq);

370  run;



NOTE: Invalid argument to function LOG(-152.415) at line 369 column 11.

gvkey=186671 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=MITT cusip=001228501 datacqtr=2020Q1

datafqtr=2020Q1 rdq=12JUN2020 atq=1558.636 ceqq=86.208 cheq=133.699 chq=92.299 cshoq=32.749

ibq=-485.017 lctq=. ltq=1199.971 saleq=-153.415 seqq=358.665 teqq=358.665 txdbq=0 capxy=0 prccq=2.74

sic=6798 MVEQ=89.73226 MTBQ=1.0408808927 BTMQ=0.9607247159 lnMVEQ=4.4968303477 lnATQ=7.3515663588

Leverageq=0.7698853356 IBQ_ATQ=-0.311180417 Loss=1 lnsaleq=. cusip6=001228 lagCAPXY=. CAPXQ=0

CAPXQ_AT=0 lagdatadate=2019/12/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=454

NOTE: Invalid argument to function LOG(-73.961) at line 369 column 11.

gvkey=186671 datadate=30JUN2020 fyearq=2020 fqtr=2 tic=MITT cusip=001228501 datacqtr=2020Q2

datafqtr=2020Q2 rdq=10AUG2020 atq=855.598 ceqq=92.921 cheq=69.234 chq=68.15 cshoq=33.825 ibq=2.7

lctq=. ltq=490.22 saleq=-74.961 seqq=365.378 teqq=365.378 txdbq=0 capxy=0 prccq=3.19 sic=6798

MVEQ=107.90175 MTBQ=1.1612202839 BTMQ=0.8611630488 lnMVEQ=4.6812210909 lnATQ=6.7518006397

Leverageq=0.572955991 IBQ_ATQ=0.0031556876 Loss=0 lnsaleq=. cusip6=001228 lagCAPXY=0 CAPXQ=0

CAPXQ_AT=0 lagdatadate=2020/03/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=455

NOTE: Invalid argument to function LOG(-0.198) at line 369 column 11.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=ACMTA cusip=004616207 datacqtr=2020Q1

datafqtr=2020Q1 rdq=30APR2020 atq=55.544 ceqq=28.126 cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639

lctq=. ltq=27.418 saleq=-1.198 seqq=28.126 teqq=28.126 txdbq=0 capxy=0.015 prccq=32.3 sic=6351

MVEQ=25.6462 MTBQ=0.9118324682 BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995

Leverageq=0.4936266743 IBQ_ATQ=-0.029508138 Loss=1 lnsaleq=. cusip6=004616 lagCAPXY=. CAPXQ=0.015

CAPXQ_AT=0.0002700562 lagdatadate=2019/12/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=2071

NOTE: Invalid argument to function LOG(-2.981) at line 369 column 11.

gvkey=036987 datadate=31MAR2021 fyearq=2021 fqtr=1 tic=ACET cusip=007002108 datacqtr=2021Q1

datafqtr=2021Q1 rdq=17MAY2021 atq=282.073 ceqq=236.259 cheq=223.42 chq=221.667 cshoq=31.802

ibq=-21.319 lctq=25.183 ltq=45.814 saleq=-3.981 seqq=236.259 teqq=236.259 txdbq=0.077 capxy=0.658

prccq=13.08 sic=2836 MVEQ=415.97016 MTBQ=1.7606531815 BTMQ=0.5679710295 lnMVEQ=6.0306135269

lnATQ=5.6421659027 Leverageq=0.1624189483 IBQ_ATQ=-0.075579726 Loss=1 lnsaleq=. cusip6=007002

lagCAPXY=. CAPXQ=0.658 CAPXQ_AT=0.0023327295 lagdatadate=2020/12/31 news=0 logesg=0 logsale=.

_ERROR_=1 _N_=2675

NOTE: Invalid argument to function LOG(-71) at line 369 column 11.

gvkey=024287 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=AMBC cusip=023139884 datacqtr=2020Q1

datafqtr=2020Q1 rdq=11MAY2020 atq=12777 ceqq=1002 cheq=774 chq=58 cshoq=45.779 ibq=-280 lctq=.

ltq=11715 saleq=-72 seqq=1002 teqq=1062 txdbq=26 capxy=0 prccq=12.34 sic=6351 MVEQ=564.91286

MTBQ=0.5637852894 BTMQ=1.7737248892 lnMVEQ=6.3366714892 lnATQ=9.4554019586 Leverageq=0.9168818972

IBQ_ATQ=-0.021914377 Loss=1 lnsaleq=. cusip6=023139 lagCAPXY=. CAPXQ=0 CAPXQ_AT=0

lagdatadate=2019/12/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=7348

NOTE: Invalid argument to function LOG(-448.549) at line 369 column 11.

gvkey=156383 datadate=31DEC2018 fyearq=2018 fqtr=4 tic=AEL cusip=025676206 datacqtr=2018Q4

datafqtr=2018Q4 rdq=06FEB2019 atq=61625.564 ceqq=2399.101 cheq=713.232 chq=344.396 cshoq=90.369

ibq=53.823 lctq=. ltq=59226.463 saleq=-449.549 seqq=2399.101 teqq=2399.101 txdbq=0 capxy=4.283

prccq=27.94 sic=6311 MVEQ=2524.90986 MTBQ=1.0524400015 BTMQ=0.9501729301 lnMVEQ=7.8339606421

lnATQ=11.028832063 Leverageq=0.9610697113 IBQ_ATQ=0.0008733875 Loss=0 lnsaleq=. cusip6=025676

lagCAPXY=3.51 CAPXQ=0.773 CAPXQ_AT=0.0000125435 lagdatadate=2018/09/30 news=0 logesg=0 logsale=.

_ERROR_=1 _N_=8003

NOTE: Invalid argument to function LOG(-320.741) at line 369 column 11.

gvkey=156383 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=AEL cusip=025676206 datacqtr=2020Q1

datafqtr=2020Q1 rdq=06MAY2020 atq=65549.556 ceqq=3522.741 cheq=2222.828 chq=1833.099 cshoq=91.498

ibq=242.947 lctq=. ltq=62026.799 saleq=-321.741 seqq=3522.757 teqq=3522.757 txdbq=0 capxy=10.11

prccq=18.8 sic=6311 MVEQ=1720.1624 MTBQ=0.4883022624 BTMQ=2.0479118716 lnMVEQ=7.450173984

lnATQ=11.090561716 Leverageq=0.9462581104 IBQ_ATQ=0.0037063104 Loss=0 lnsaleq=. cusip6=025676

lagCAPXY=. CAPXQ=10.11 CAPXQ_AT=0.0001542345 lagdatadate=2019/12/31 news=0 logesg=0 logsale=.

_ERROR_=1 _N_=8008

NOTE: Invalid argument to function LOG(-319.326) at line 369 column 11.

gvkey=065556 datadate=31DEC2018 fyearq=2018 fqtr=4 tic=NLY cusip=035710409 datacqtr=2018Q4

datafqtr=2018Q4 rdq=13FEB2019 atq=105787.527 ceqq=12333.944 cheq=2385.789 chq=1735.749 cshoq=1313.763

ibq=-2254.889 lctq=. ltq=91669.726 saleq=-320.326 seqq=14112.112 teqq=14117.801 txdbq=0 capxy=0

prccq=9.82 sic=6798 MVEQ=12901.15266 MTBQ=1.0459876143 BTMQ=0.9560342649 lnMVEQ=9.4650719398

lnATQ=11.569187899 Leverageq=0.866545694 IBQ_ATQ=-0.021315263 Loss=1 lnsaleq=. cusip6=035710

lagCAPXY=0 CAPXQ=0 CAPXQ_AT=0 lagdatadate=2018/09/30 news=0 logesg=0 logsale=. _ERROR_=1 _N_=9782

NOTE: Invalid argument to function LOG(-248.198) at line 369 column 11.

gvkey=018465 datadate=30JUN2016 fyearq=2016 fqtr=2 tic=AR cusip=03674X106 datacqtr=2016Q2

datafqtr=2016Q2 rdq=02AUG2016 atq=13558.78 ceqq=6233.402 cheq=28.251 chq=28.251 cshoq=304.158

ibq=-596.244 lctq=569.432 ltq=5957.881 saleq=-249.198 seqq=6233.402 teqq=7600.899 txdbq=1063.331

capxy=945.39 prccq=25.98 sic=1311 MVEQ=7902.02484 MTBQ=1.2676905549 BTMQ=0.7888360422

lnMVEQ=8.9748743145 lnATQ=9.5147895869 Leverageq=0.4394112892 IBQ_ATQ=-0.043974753 Loss=1 lnsaleq=.

cusip6=03674X lagCAPXY=510.123 CAPXQ=435.267 CAPXQ_AT=0.0321022245 lagdatadate=2016/03/31 news=0

logesg=0 logsale=. _ERROR_=1 _N_=9891

NOTE: Invalid argument to function LOG(-69.605) at line 369 column 11.

gvkey=066654 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=ANH cusip=037347101 datacqtr=2020Q1

datafqtr=2020Q1 rdq=07MAY2020 atq=3551.011 ceqq=269.431 cheq=208.014 chq=55.561 cshoq=98.936

ibq=-185.821 lctq=. ltq=3166.962 saleq=-70.605 seqq=384.049 teqq=384.049 txdbq=0 capxy=0 prccq=1.13

sic=6798 MVEQ=111.79768 MTBQ=0.414939929 BTMQ=2.4099873987 lnMVEQ=4.7166908092 lnATQ=8.1749876307

Leverageq=0.8918479836 IBQ_ATQ=-0.052329041 Loss=1 lnsaleq=. cusip6=037347 lagCAPXY=. CAPXQ=0

CAPXQ_AT=0 lagdatadate=2019/12/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=10047

NOTE: Invalid argument to function LOG(-113.885) at line 369 column 11.

gvkey=184254 datadate=31DEC2018 fyearq=2018 fqtr=4 tic=APO cusip=03768E105 datacqtr=2018Q4

datafqtr=2018Q4 rdq=31JAN2019 atq=5991.654 ceqq=821.983 cheq=662.875 chq=659.418 cshoq=201.401

ibq=-187.245 lctq=. ltq=3539.814 saleq=-114.885 seqq=1376.196 teqq=2451.84 txdbq=0 capxy=14.741

prccq=24.54 sic=6282 MVEQ=4942.38054 MTBQ=6.0127527455 BTMQ=0.1663131751 lnMVEQ=8.5056023848

lnATQ=8.6981227799 Leverageq=0.59079079 IBQ_ATQ=-0.03125097 Loss=1 lnsaleq=. cusip6=03768E

lagCAPXY=10.01 CAPXQ=4.731 CAPXQ_AT=0.0007895983 lagdatadate=2018/09/30 news=0 logesg=0 logsale=.

_ERROR_=1 _N_=10290

NOTE: Invalid argument to function LOG(-1468.086) at line 369 column 11.

gvkey=184254 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=APO cusip=03768E105 datacqtr=2020Q1

datafqtr=2020Q1 rdq=01MAY2020 atq=16322.797 ceqq=2.425 cheq=1296.645 chq=1276.881 cshoq=228.834

ibq=-996.218 lctq=. ltq=12823.763 saleq=-1469.086 seqq=556.638 teqq=3499.034 txdbq=0 capxy=18.168

prccq=33.5 sic=6282 MVEQ=7665.939 MTBQ=3161.2119588 BTMQ=0.0003163344 lnMVEQ=8.9445422887

lnATQ=9.7003179986 Leverageq=0.7856351457 IBQ_ATQ=-0.06103231 Loss=1 lnsaleq=. cusip6=03768E

lagCAPXY=. CAPXQ=18.168 CAPXQ_AT=0.0011130445 lagdatadate=2019/12/31 news=1 logesg=0.6931471806

logsale=. _ERROR_=1 _N_=10295

NOTE: Invalid argument to function LOG(-20.136) at line 369 column 11.

gvkey=066085 datadate=31MAR2016 fyearq=2016 fqtr=1 tic=AAIC cusip=041356205 datacqtr=2016Q1

datafqtr=2016Q1 rdq=10MAY2016 atq=3791.289 ceqq=433.673 cheq=3474.214 chq=43.184 cshoq=22.977

ibq=-31.618 lctq=. ltq=3357.616 saleq=-21.136 seqq=433.673 teqq=433.673 txdbq=0 capxy=0 prccq=12.53

sic=6799 MVEQ=287.90181 MTBQ=0.6638684216 BTMQ=1.5063225896 lnMVEQ=5.6626194845 lnATQ=8.2404613458

Leverageq=0.8856133099 IBQ_ATQ=-0.008339644 Loss=1 lnsaleq=. cusip6=041356 lagCAPXY=. CAPXQ=0

CAPXQ_AT=0 lagdatadate=2015/12/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=11706

NOTE: Invalid argument to function LOG(-5.626) at line 369 column 11.

gvkey=066085 datadate=31DEC2016 fyearq=2016 fqtr=4 tic=AAIC cusip=041356205 datacqtr=2016Q4

datafqtr=2016Q4 rdq=07FEB2017 atq=4141.554 ceqq=383.416 cheq=3967.435 chq=54.794 cshoq=23.627

ibq=-41.436 lctq=. ltq=3758.138 saleq=-6.626 seqq=383.416 teqq=383.416 txdbq=0 capxy=0 prccq=14.82

sic=6799 MVEQ=350.15214 MTBQ=0.9132434223 BTMQ=1.0949983056 lnMVEQ=5.8583677457 lnATQ=8.3288263587

Leverageq=0.9074221898 IBQ_ATQ=-0.01000494 Loss=1 lnsaleq=. cusip6=041356 lagCAPXY=0 CAPXQ=0

CAPXQ_AT=0 lagdatadate=2016/09/30 news=0 logesg=0 logsale=. _ERROR_=1 _N_=11709

NOTE: Invalid argument to function LOG(-16.279) at line 369 column 11.

gvkey=066085 datadate=31MAR2018 fyearq=2018 fqtr=1 tic=AAIC cusip=041356205 datacqtr=2018Q1

datafqtr=2018Q1 rdq=02MAY2018 atq=4460.519 ceqq=311.438 cheq=3922.312 chq=15.219 cshoq=28.141

ibq=-56.383 lctq=. ltq=4141.514 saleq=-17.279 seqq=319.005 teqq=319.005 txdbq=17.518 capxy=0

prccq=11.04 sic=6799 MVEQ=310.67664 MTBQ=0.9975553401 BTMQ=1.0024506509 lnMVEQ=5.7387526285

lnATQ=8.403020406 Leverageq=0.9284825376 IBQ_ATQ=-0.012640457 Loss=1 lnsaleq=. cusip6=041356

lagCAPXY=. CAPXQ=0 CAPXQ_AT=0 lagdatadate=2017/12/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=11714

NOTE: Invalid argument to function LOG(-30.736) at line 369 column 11.

gvkey=066085 datadate=31DEC2018 fyearq=2018 fqtr=4 tic=AAIC cusip=041356205 datacqtr=2018Q4

datafqtr=2018Q4 rdq=19FEB2019 atq=4099.45 ceqq=266.199 cheq=4008.843 chq=26.713 cshoq=30.498

ibq=-26.305 lctq=. ltq=3825.006 saleq=-31.736 seqq=274.444 teqq=274.444 txdbq=0 capxy=0 prccq=7.24

sic=6799 MVEQ=220.80552 MTBQ=0.8294753925 BTMQ=1.2055812735 lnMVEQ=5.3972823141 lnATQ=8.3186080974

Leverageq=0.9330534584 IBQ_ATQ=-0.006416714 Loss=1 lnsaleq=. cusip6=041356 lagCAPXY=0 CAPXQ=0

CAPXQ_AT=0 lagdatadate=2018/09/30 news=0 logesg=0 logsale=. _ERROR_=1 _N_=11717

NOTE: Invalid argument to function LOG(-74.095) at line 369 column 11.

gvkey=066085 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=AAIC cusip=041356205 datacqtr=2020Q1

datafqtr=2020Q1 rdq=11MAY2020 atq=2358.307 ceqq=195.611 cheq=767 chq=89.376 cshoq=36.816 ibq=-94.17

lctq=. ltq=2125.498 saleq=-75.095 seqq=232.809 teqq=232.809 txdbq=0 capxy=0 prccq=2.19 sic=6799

MVEQ=80.62704 MTBQ=0.4121805011 BTMQ=2.4261215592 lnMVEQ=4.3898340771 lnATQ=7.7656992677

Leverageq=0.9012813005 IBQ_ATQ=-0.039931188 Loss=1 lnsaleq=. cusip6=041356 lagCAPXY=. CAPXQ=0

CAPXQ_AT=0 lagdatadate=2019/12/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=11722

NOTE: Invalid argument to function LOG(-0.987) at line 369 column 11.

gvkey=066085 datadate=30JUN2021 fyearq=2021 fqtr=2 tic=AAIC cusip=041356205 datacqtr=2021Q2

datafqtr=2021Q2 rdq=03AUG2021 atq=1030.097 ceqq=193.463 cheq=775.731 chq=2.349 cshoq=32.68 ibq=-7.059

lctq=. ltq=801.345 saleq=-1.987 seqq=228.752 teqq=228.752 txdbq=0 capxy=0 prccq=4.06 sic=6799

MVEQ=132.6808 MTBQ=0.6858200276 BTMQ=1.4581084829 lnMVEQ=4.8879462436 lnATQ=6.9374082515

Leverageq=0.7779315928 IBQ_ATQ=-0.006852753 Loss=1 lnsaleq=. cusip6=041356 lagCAPXY=0 CAPXQ=0

CAPXQ_AT=0 lagdatadate=2021/03/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=11727

NOTE: Invalid argument to function LOG(-10.578) at line 369 column 11.

gvkey=183822 datadate=31DEC2018 fyearq=2018 fqtr=4 tic=ARR cusip=042315507 datacqtr=2018Q4

datafqtr=2018Q4 rdq=14FEB2019 atq=8464.61 ceqq=1125.305 cheq=330.845 chq=221.668 cshoq=43.702

ibq=-211.979 lctq=. ltq=7339.297 saleq=-11.578 seqq=1125.313 teqq=1125.313 txdbq=0 capxy=0 prccq=20.5

sic=6798 MVEQ=895.891 MTBQ=0.7961317154 BTMQ=1.2560735625 lnMVEQ=6.7978187538 lnATQ=9.0436492214

Leverageq=0.867056722 IBQ_ATQ=-0.025042973 Loss=1 lnsaleq=. cusip6=042315 lagCAPXY=0 CAPXQ=0

CAPXQ_AT=0 lagdatadate=2018/09/30 news=0 logesg=0 logsale=. _ERROR_=1 _N_=11834

NOTE: Invalid argument to function LOG(-35.685) at line 369 column 11.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=183822 datadate=31MAR2021 fyearq=2021 fqtr=1 tic=ARR cusip=042315507 datacqtr=2021Q1

datafqtr=2021Q1 rdq=21APR2021 atq=5349.5 ceqq=1027.18 cheq=330.35 chq=277.554 cshoq=69.748 ibq=71.327

lctq=. ltq=4322.314 saleq=-36.685 seqq=1027.186 teqq=1027.186 txdbq=0 capxy=0 prccq=12.2 sic=6798

MVEQ=850.9256 MTBQ=0.8284094316 BTMQ=1.2071325625 lnMVEQ=6.7463246982 lnATQ=8.5847583776

Leverageq=0.8079846715 IBQ_ATQ=0.0133333956 Loss=0 lnsaleq=. cusip6=042315 lagCAPXY=. CAPXQ=0

CAPXQ_AT=0 lagdatadate=2020/12/31 news=0 logesg=0 logsale=. _ERROR_=1 _N_=11843

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1464 at 369:11   1464 at 369:16   

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      243 at 369:11   

NOTE: There were 167105 observations read from the data set WORK.REP5.

NOTE: The data set WORK.REP5 has 167105 observations and 41 variables.

NOTE: DATA statement used (Total process time):

      real time           0.06 seconds

      cpu time            0.06 seconds

      



371  

372  /*next quarter sales*/

373  proc sql;

374  create table rep5 as select

375  a.*, b.saleq as saleq_f1

376  from rep5 as a left join qcompustat as b

377  on a.cusip6 = b.cusip6

378  and a.datadate = b.lagdatadate

379  order by cusip6, datadate;

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this 

         is a possible data integrity problem.

NOTE: Table WORK.REP5 created, with 167105 rows and 42 columns.



380  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.28 seconds

      cpu time            0.29 seconds

      



381  

382  proc sort data = rep5 nodupkey;

383  by cusip6 datadate;

384  run;



NOTE: There were 167105 observations read from the data set WORK.REP5.

NOTE: 0 observations with duplicate key values were deleted.

NOTE: The data set WORK.REP5 has 167105 observations and 42 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.14 seconds

      cpu time            0.15 seconds

      



385  

386  data rep5;

387  set rep5;

388  if news = . then news = 0;

389  logesg = log(1+news);

390  logsale = log(1+saleq);

391  logsale_f1 = log(1+saleq_f1);

392  run;



NOTE: Invalid argument to function LOG(-152.415) at line 391 column 14.

gvkey=186671 datadate=31DEC2019 fyearq=2019 fqtr=4 tic=MITT cusip=001228501 datacqtr=2019Q4

datafqtr=2019Q4 rdq=27FEB2020 atq=4347.817 ceqq=576.589 cheq=125.369 chq=81.692 cshoq=32.742

ibq=36.172 lctq=. ltq=3498.771 saleq=69.208 seqq=849.046 teqq=849.046 txdbq=0 capxy=0 prccq=15.42

sic=6798 MVEQ=504.88164 MTBQ=0.8756352272 BTMQ=1.1420280603 lnMVEQ=6.2243240256 lnATQ=8.377429159

Leverageq=0.8047190119 IBQ_ATQ=0.0083195774 Loss=0 lnsaleq=4.2514622647 cusip6=001228 lagCAPXY=0

CAPXQ=0 CAPXQ_AT=0 lagdatadate=2019/09/30 news=0 logesg=0 logsale=4.2514622647 saleq_f1=-153.415

logsale_f1=. _ERROR_=1 _N_=453

NOTE: Invalid argument to function LOG(-152.415) at line 390 column 11.

NOTE: Invalid argument to function LOG(-73.961) at line 391 column 14.

gvkey=186671 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=MITT cusip=001228501 datacqtr=2020Q1

datafqtr=2020Q1 rdq=12JUN2020 atq=1558.636 ceqq=86.208 cheq=133.699 chq=92.299 cshoq=32.749

ibq=-485.017 lctq=. ltq=1199.971 saleq=-153.415 seqq=358.665 teqq=358.665 txdbq=0 capxy=0 prccq=2.74

sic=6798 MVEQ=89.73226 MTBQ=1.0408808927 BTMQ=0.9607247159 lnMVEQ=4.4968303477 lnATQ=7.3515663588

Leverageq=0.7698853356 IBQ_ATQ=-0.311180417 Loss=1 lnsaleq=. cusip6=001228 lagCAPXY=. CAPXQ=0

CAPXQ_AT=0 lagdatadate=2019/12/31 news=0 logesg=0 logsale=. saleq_f1=-74.961 logsale_f1=. _ERROR_=1

_N_=454

NOTE: Invalid argument to function LOG(-73.961) at line 390 column 11.

gvkey=186671 datadate=30JUN2020 fyearq=2020 fqtr=2 tic=MITT cusip=001228501 datacqtr=2020Q2

datafqtr=2020Q2 rdq=10AUG2020 atq=855.598 ceqq=92.921 cheq=69.234 chq=68.15 cshoq=33.825 ibq=2.7

lctq=. ltq=490.22 saleq=-74.961 seqq=365.378 teqq=365.378 txdbq=0 capxy=0 prccq=3.19 sic=6798

MVEQ=107.90175 MTBQ=1.1612202839 BTMQ=0.8611630488 lnMVEQ=4.6812210909 lnATQ=6.7518006397

Leverageq=0.572955991 IBQ_ATQ=0.0031556876 Loss=0 lnsaleq=. cusip6=001228 lagCAPXY=0 CAPXQ=0

CAPXQ_AT=0 lagdatadate=2020/03/31 news=0 logesg=0 logsale=. saleq_f1=12.473 logsale_f1=2.6006876828

_ERROR_=1 _N_=455

NOTE: Invalid argument to function LOG(-0.198) at line 391 column 14.

gvkey=001097 datadate=31DEC2019 fyearq=2019 fqtr=4 tic=ACMTA cusip=004616207 datacqtr=2019Q4

datafqtr=2019Q4 rdq=24APR2020 atq=58.515 ceqq=31.197 cheq=8.823 chq=1.529 cshoq=0.794 ibq=0.6 lctq=.

ltq=27.318 saleq=0.878 seqq=31.197 teqq=31.197 txdbq=0.432 capxy=0.048 prccq=32.4 sic=6351

MVEQ=25.7256 MTBQ=0.8246177517 BTMQ=1.2126830861 lnMVEQ=3.2474866051 lnATQ=4.0692831316

Leverageq=0.4668546527 IBQ_ATQ=0.0102537811 Loss=0 lnsaleq=0.6302073808 cusip6=004616 lagCAPXY=0.048

CAPXQ=0 CAPXQ_AT=0 lagdatadate=2019/09/30 news=0 logesg=0 logsale=0.6302073808 saleq_f1=-1.198

logsale_f1=. _ERROR_=1 _N_=2070

NOTE: Invalid argument to function LOG(-0.198) at line 390 column 11.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=ACMTA cusip=004616207 datacqtr=2020Q1

datafqtr=2020Q1 rdq=30APR2020 atq=55.544 ceqq=28.126 cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639

lctq=. ltq=27.418 saleq=-1.198 seqq=28.126 teqq=28.126 txdbq=0 capxy=0.015 prccq=32.3 sic=6351

MVEQ=25.6462 MTBQ=0.9118324682 BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995

Leverageq=0.4936266743 IBQ_ATQ=-0.029508138 Loss=1 lnsaleq=. cusip6=004616 lagCAPXY=. CAPXQ=0.015

CAPXQ_AT=0.0002700562 lagdatadate=2019/12/31 news=0 logesg=0 logsale=. saleq_f1=1.456

logsale_f1=0.8985340103 _ERROR_=1 _N_=2071

NOTE: Invalid argument to function LOG(-2.981) at line 391 column 14.

gvkey=036987 datadate=31DEC2020 fyearq=2020 fqtr=4 tic=ACET cusip=007002108 datacqtr=2020Q4

datafqtr=2020Q4 rdq=11MAR2021 atq=153.835 ceqq=109.827 cheq=94.614 chq=84.33 cshoq=19.677 ibq=-8.958

lctq=22.479 ltq=44.008 saleq=5.41 seqq=109.827 teqq=109.827 txdbq=0.125 capxy=0.99 prccq=14.05

sic=2836 MVEQ=276.46185 MTBQ=2.5172484908 BTMQ=0.3972591517 lnMVEQ=5.6220728368 lnATQ=5.0358805995

Leverageq=0.2860727403 IBQ_ATQ=-0.058231222 Loss=1 lnsaleq=1.8578592709 cusip6=007002 lagCAPXY=0.63

CAPXQ=0.36 CAPXQ_AT=0.0023401697 lagdatadate=2020/09/30 news=0 logesg=0 logsale=1.8578592709

saleq_f1=-3.981 logsale_f1=. _ERROR_=1 _N_=2674

NOTE: Invalid argument to function LOG(-2.981) at line 390 column 11.

gvkey=036987 datadate=31MAR2021 fyearq=2021 fqtr=1 tic=ACET cusip=007002108 datacqtr=2021Q1

datafqtr=2021Q1 rdq=17MAY2021 atq=282.073 ceqq=236.259 cheq=223.42 chq=221.667 cshoq=31.802

ibq=-21.319 lctq=25.183 ltq=45.814 saleq=-3.981 seqq=236.259 teqq=236.259 txdbq=0.077 capxy=0.658

prccq=13.08 sic=2836 MVEQ=415.97016 MTBQ=1.7606531815 BTMQ=0.5679710295 lnMVEQ=6.0306135269

lnATQ=5.6421659027 Leverageq=0.1624189483 IBQ_ATQ=-0.075579726 Loss=1 lnsaleq=. cusip6=007002

lagCAPXY=. CAPXQ=0.658 CAPXQ_AT=0.0023327295 lagdatadate=2020/12/31 news=0 logesg=0 logsale=.

saleq_f1=4.814 logsale_f1=1.7602688021 _ERROR_=1 _N_=2675

NOTE: Invalid argument to function LOG(-71) at line 391 column 14.

gvkey=024287 datadate=31DEC2019 fyearq=2019 fqtr=4 tic=AMBC cusip=023139884 datacqtr=2019Q4

datafqtr=2019Q4 rdq=02MAR2020 atq=13320 ceqq=1477 cheq=830 chq=24 cshoq=45.555 ibq=-110.486 lctq=.

ltq=11784 saleq=130.342 seqq=1477 teqq=1536 txdbq=32 capxy=0 prccq=21.57 sic=6351 MVEQ=982.62135

MTBQ=0.665281889 BTMQ=1.5031222352 lnMVEQ=6.8902238476 lnATQ=9.4970219441 Leverageq=0.8846846847

IBQ_ATQ=-0.008294745 Loss=1 lnsaleq=4.8778046083 cusip6=023139 lagCAPXY=0 CAPXQ=0 CAPXQ_AT=0

lagdatadate=2019/09/30 news=0 logesg=0 logsale=4.8778046083 saleq_f1=-72 logsale_f1=. _ERROR_=1

_N_=7347

NOTE: Invalid argument to function LOG(-71) at line 390 column 11.

gvkey=024287 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=AMBC cusip=023139884 datacqtr=2020Q1

datafqtr=2020Q1 rdq=11MAY2020 atq=12777 ceqq=1002 cheq=774 chq=58 cshoq=45.779 ibq=-280 lctq=.

ltq=11715 saleq=-72 seqq=1002 teqq=1062 txdbq=26 capxy=0 prccq=12.34 sic=6351 MVEQ=564.91286

MTBQ=0.5637852894 BTMQ=1.7737248892 lnMVEQ=6.3366714892 lnATQ=9.4554019586 Leverageq=0.9168818972

IBQ_ATQ=-0.021914377 Loss=1 lnsaleq=. cusip6=023139 lagCAPXY=. CAPXQ=0 CAPXQ_AT=0

lagdatadate=2019/12/31 news=0 logesg=0 logsale=. saleq_f1=74 logsale_f1=4.3174881135 _ERROR_=1

_N_=7348

NOTE: Invalid argument to function LOG(-448.549) at line 391 column 14.

gvkey=156383 datadate=30SEP2018 fyearq=2018 fqtr=3 tic=AEL cusip=025676206 datacqtr=2018Q3

datafqtr=2018Q3 rdq=05NOV2018 atq=63448.998 ceqq=2489.296 cheq=1416.919 chq=1129.242 cshoq=90.278

ibq=169.328 lctq=. ltq=60959.702 saleq=1193.299 seqq=2489.296 teqq=2489.296 txdbq=0 capxy=3.51

prccq=35.36 sic=6311 MVEQ=3192.23008 MTBQ=1.2823826817 BTMQ=0.7797984286 lnMVEQ=8.0684750362

lnATQ=11.057991681 Leverageq=0.960766977 IBQ_ATQ=0.0026687261 Loss=0 lnsaleq=7.0853146814

cusip6=025676 lagCAPXY=2.774 CAPXQ=0.736 CAPXQ_AT=0.0000115999 lagdatadate=2018/06/30 news=0 logesg=0

logsale=7.0853146814 saleq_f1=-449.549 logsale_f1=. _ERROR_=1 _N_=8002

NOTE: Invalid argument to function LOG(-448.549) at line 390 column 11.

gvkey=156383 datadate=31DEC2018 fyearq=2018 fqtr=4 tic=AEL cusip=025676206 datacqtr=2018Q4

datafqtr=2018Q4 rdq=06FEB2019 atq=61625.564 ceqq=2399.101 cheq=713.232 chq=344.396 cshoq=90.369

ibq=53.823 lctq=. ltq=59226.463 saleq=-449.549 seqq=2399.101 teqq=2399.101 txdbq=0 capxy=4.283

prccq=27.94 sic=6311 MVEQ=2524.90986 MTBQ=1.0524400015 BTMQ=0.9501729301 lnMVEQ=7.8339606421

lnATQ=11.028832063 Leverageq=0.9610697113 IBQ_ATQ=0.0008733875 Loss=0 lnsaleq=. cusip6=025676

lagCAPXY=3.51 CAPXQ=0.773 CAPXQ_AT=0.0000125435 lagdatadate=2018/09/30 news=0 logesg=0 logsale=.

saleq_f1=1001.417 logsale_f1=6.9101693627 _ERROR_=1 _N_=8003

NOTE: Invalid argument to function LOG(-320.741) at line 391 column 14.

gvkey=156383 datadate=31DEC2019 fyearq=2019 fqtr=4 tic=AEL cusip=025676206 datacqtr=2019Q4

datafqtr=2019Q4 rdq=12FEB2020 atq=69696.552 ceqq=4570.103 cheq=2587.604 chq=2293.392 cshoq=91.108

ibq=220.15 lctq=. ltq=65126.433 saleq=1115.847 seqq=4570.119 teqq=4570.119 txdbq=177.897 capxy=4.022

prccq=29.93 sic=6311 MVEQ=2726.86244 MTBQ=0.5966741756 BTMQ=1.675956562 lnMVEQ=7.9109069379

lnATQ=11.151906126 Leverageq=0.9344283344 IBQ_ATQ=0.0031586928 Loss=0 lnsaleq=7.0182648156

cusip6=025676 lagCAPXY=3.148 CAPXQ=0.874 CAPXQ_AT=0.0000125401 lagdatadate=2019/09/30 news=0 logesg=0

logsale=7.0182648156 saleq_f1=-321.741 logsale_f1=. _ERROR_=1 _N_=8007

NOTE: Invalid argument to function LOG(-320.741) at line 390 column 11.

gvkey=156383 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=AEL cusip=025676206 datacqtr=2020Q1

datafqtr=2020Q1 rdq=06MAY2020 atq=65549.556 ceqq=3522.741 cheq=2222.828 chq=1833.099 cshoq=91.498

ibq=242.947 lctq=. ltq=62026.799 saleq=-321.741 seqq=3522.757 teqq=3522.757 txdbq=0 capxy=10.11

prccq=18.8 sic=6311 MVEQ=1720.1624 MTBQ=0.4883022624 BTMQ=2.0479118716 lnMVEQ=7.450173984

lnATQ=11.090561716 Leverageq=0.9462581104 IBQ_ATQ=0.0037063104 Loss=0 lnsaleq=. cusip6=025676

lagCAPXY=. CAPXQ=10.11 CAPXQ_AT=0.0001542345 lagdatadate=2019/12/31 news=0 logesg=0 logsale=.

saleq_f1=919.948 logsale_f1=6.8254035743 _ERROR_=1 _N_=8008

NOTE: Invalid argument to function LOG(-319.326) at line 391 column 14.

gvkey=065556 datadate=30SEP2018 fyearq=2018 fqtr=3 tic=NLY cusip=035710409 datacqtr=2018Q3

datafqtr=2018Q3 rdq=31OCT2018 atq=105961.803 ceqq=13171.826 cheq=2317.451 chq=1082.747 cshoq=1303.08

ibq=385.578 lctq=. ltq=91005.947 saleq=576.486 seqq=14949.994 teqq=14955.856 txdbq=0 capxy=0

prccq=10.23 sic=6798 MVEQ=13330.5084 MTBQ=1.0120471072 BTMQ=0.988096298 lnMVEQ=9.497810552

lnATQ=11.570833959 Leverageq=0.8588561578 IBQ_ATQ=0.0036388396 Loss=0 lnsaleq=6.3586841997

cusip6=035710 lagCAPXY=0 CAPXQ=0 CAPXQ_AT=0 lagdatadate=2018/06/30 news=0 logesg=0

logsale=6.3586841997 saleq_f1=-320.326 logsale_f1=. _ERROR_=1 _N_=9781

NOTE: Invalid argument to function LOG(-319.326) at line 390 column 11.

gvkey=065556 datadate=31DEC2018 fyearq=2018 fqtr=4 tic=NLY cusip=035710409 datacqtr=2018Q4

datafqtr=2018Q4 rdq=13FEB2019 atq=105787.527 ceqq=12333.944 cheq=2385.789 chq=1735.749 cshoq=1313.763

ibq=-2254.889 lctq=. ltq=91669.726 saleq=-320.326 seqq=14112.112 teqq=14117.801 txdbq=0 capxy=0

prccq=9.82 sic=6798 MVEQ=12901.15266 MTBQ=1.0459876143 BTMQ=0.9560342649 lnMVEQ=9.4650719398

lnATQ=11.569187899 Leverageq=0.866545694 IBQ_ATQ=-0.021315263 Loss=1 lnsaleq=. cusip6=035710

lagCAPXY=0 CAPXQ=0 CAPXQ_AT=0 lagdatadate=2018/09/30 news=0 logesg=0 logsale=. saleq_f1=687.613

logsale_f1=6.5346794296 _ERROR_=1 _N_=9782

NOTE: Invalid argument to function LOG(-248.198) at line 391 column 14.

gvkey=018465 datadate=31MAR2016 fyearq=2016 fqtr=1 tic=AR cusip=03674X106 datacqtr=2016Q1

datafqtr=2016Q1 rdq=27APR2016 atq=14288.712 ceqq=6058.282 cheq=39.87 chq=39.87 cshoq=277.061

ibq=-5.055 lctq=645.084 ltq=6868.368 saleq=721.004 seqq=6058.282 teqq=7420.344 txdbq=1439.825

capxy=510.123 prccq=24.87 sic=1311 MVEQ=6890.50707 MTBQ=1.1373698138 BTMQ=0.8792215055

lnMVEQ=8.8378999564 lnATQ=9.5672251339 Leverageq=0.4806848931 IBQ_ATQ=-0.000353776 Loss=1

lnsaleq=6.582030679 cusip6=03674X lagCAPXY=. CAPXQ=510.123 CAPXQ_AT=0.0357011185

lagdatadate=2015/12/31 news=0 logesg=0 logsale=6.582030679 saleq_f1=-249.198 logsale_f1=. _ERROR_=1

_N_=9890

NOTE: Invalid argument to function LOG(-248.198) at line 390 column 11.

gvkey=018465 datadate=30JUN2016 fyearq=2016 fqtr=2 tic=AR cusip=03674X106 datacqtr=2016Q2

datafqtr=2016Q2 rdq=02AUG2016 atq=13558.78 ceqq=6233.402 cheq=28.251 chq=28.251 cshoq=304.158

ibq=-596.244 lctq=569.432 ltq=5957.881 saleq=-249.198 seqq=6233.402 teqq=7600.899 txdbq=1063.331

capxy=945.39 prccq=25.98 sic=1311 MVEQ=7902.02484 MTBQ=1.2676905549 BTMQ=0.7888360422

lnMVEQ=8.9748743145 lnATQ=9.5147895869 Leverageq=0.4394112892 IBQ_ATQ=-0.043974753 Loss=1 lnsaleq=.

cusip6=03674X lagCAPXY=510.123 CAPXQ=435.267 CAPXQ_AT=0.0321022245 lagdatadate=2016/03/31 news=0

logesg=0 logsale=. saleq_f1=1116.503 logsale_f1=7.018852011 _ERROR_=1 _N_=9891

NOTE: Invalid argument to function LOG(-69.605) at line 391 column 14.

gvkey=066654 datadate=31DEC2019 fyearq=2019 fqtr=4 tic=ANH cusip=037347101 datacqtr=2019Q4

datafqtr=2019Q4 rdq=25FEB2020 atq=4938.631 ceqq=457.334 cheq=127.935 chq=8.236 cshoq=98.849 ibq=29.743

lctq=. ltq=4366.679 saleq=37.564 seqq=571.952 teqq=571.952 txdbq=0 capxy=0 prccq=3.52 sic=6798

MVEQ=347.94848 MTBQ=0.7608191825 BTMQ=1.3143727485 lnMVEQ=5.8520544228 lnATQ=8.5048434463

Leverageq=0.8841881485 IBQ_ATQ=0.0060225192 Loss=0 lnsaleq=3.6523191988 cusip6=037347 lagCAPXY=0

CAPXQ=0 CAPXQ_AT=0 lagdatadate=2019/09/30 news=0 logesg=0 logsale=3.6523191988 saleq_f1=-70.605

logsale_f1=. _ERROR_=1 _N_=10046

NOTE: Invalid argument to function LOG(-69.605) at line 390 column 11.

gvkey=066654 datadate=31MAR2020 fyearq=2020 fqtr=1 tic=ANH cusip=037347101 datacqtr=2020Q1

datafqtr=2020Q1 rdq=07MAY2020 atq=3551.011 ceqq=269.431 cheq=208.014 chq=55.561 cshoq=98.936

ibq=-185.821 lctq=. ltq=3166.962 saleq=-70.605 seqq=384.049 teqq=384.049 txdbq=0 capxy=0 prccq=1.13

sic=6798 MVEQ=111.79768 MTBQ=0.414939929 BTMQ=2.4099873987 lnMVEQ=4.7166908092 lnATQ=8.1749876307

Leverageq=0.8918479836 IBQ_ATQ=-0.052329041 Loss=1 lnsaleq=. cusip6=037347 lagCAPXY=. CAPXQ=0

CAPXQ_AT=0 lagdatadate=2019/12/31 news=0 logesg=0 logsale=. saleq_f1=56.577 logsale_f1=4.0531231824

_ERROR_=1 _N_=10047

NOTE: Invalid argument to function LOG(-113.885) at line 391 column 14.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=184254 datadate=30SEP2018 fyearq=2018 fqtr=3 tic=APO cusip=03768E105 datacqtr=2018Q3

datafqtr=2018Q3 rdq=31OCT2018 atq=6972.158 ceqq=1073.196 cheq=911.329 chq=907.869 cshoq=201.089

ibq=171.521 lctq=. ltq=3978.329 saleq=517.731 seqq=1627.409 teqq=2993.829 txdbq=0 capxy=10.01

prccq=34.55 sic=6282 MVEQ=6947.62495 MTBQ=6.473770821 BTMQ=0.1544694781 lnMVEQ=8.8461551463

lnATQ=8.8496800685 Leverageq=0.570602244 IBQ_ATQ=0.0246008481 Loss=0 lnsaleq=6.2513854444

cusip6=03768E lagCAPXY=5.108 CAPXQ=4.902 CAPXQ_AT=0.0007030822 lagdatadate=2018/06/30 news=0 logesg=0

logsale=6.2513854444 saleq_f1=-114.885 logsale_f1=. _ERROR_=1 _N_=10289

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1464 at 390:11    1464 at 390:16    31336 at 391:14   31336 at 391:19   

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      243 at 390:11   213 at 391:14   

NOTE: There were 167105 observations read from the data set WORK.REP5.

NOTE: The data set WORK.REP5 has 167105 observations and 43 variables.

NOTE: DATA statement used (Total process time):

      real time           0.06 seconds

      cpu time            0.04 seconds

      



393  

394  data rep5;

395  set rep5;

396  if year(datadate)<2018 then delete;

397  if year(datadate)>2020 then delete;

398  run;



NOTE: There were 167105 observations read from the data set WORK.REP5.

NOTE: The data set WORK.REP5 has 89196 observations and 43 variables.

NOTE: DATA statement used (Total process time):

      real time           0.04 seconds

      cpu time            0.04 seconds

      



399  

400  /**********5. Add an indicator to indicate thr firm is the sample******/

401  proc import out = tic

402  datafile = "H:\project\ESG News and Customer\Data\ticnewsdate1013.dta"

403  dbms = '' replace;

404  run;



NOTE: One or more variables were converted because the data type is not supported by the V9 engine. 

      For more details, run with options MSGLEVEL=I.

NOTE: The import data set has 2735 observations and 13 variables.

NOTE: WORK.TIC data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



405  

406  

407  proc sort data = tic nodupkey out = gvkey; by gvkey; run;



NOTE: There were 2735 observations read from the data set WORK.TIC.

NOTE: 2484 observations with duplicate key values were deleted.

NOTE: The data set WORK.GVKEY has 251 observations and 13 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



408  

409  data gvkey;

410  set gvkey;

411  keep gvkey1 insample;

412  insample = 1;

413  gvkey1 = put(gvkey, z6.);

414  run;



NOTE: There were 251 observations read from the data set WORK.GVKEY.

NOTE: The data set WORK.GVKEY has 251 observations and 2 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



415  

416  proc sql;

417  create table rep5 as select

418  a.*, b.insample

419  from rep5 as a left join gvkey as b

420  on a.gvkey = b.gvkey1

421  order by cusip6, datadate;

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of this 

         is a possible data integrity problem.

NOTE: Table WORK.REP5 created, with 89196 rows and 44 columns.



422  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.18 seconds

      cpu time            0.20 seconds

      



423  

424  data rep5;

425  set rep5;

426  if insample = . then insample = 0;

427  run;



NOTE: There were 89196 observations read from the data set WORK.REP5.

NOTE: The data set WORK.REP5 has 89196 observations and 44 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



428  

429  proc freq data = rep5;

430  tables insample;

431  run;



NOTE: There were 89196 observations read from the data set WORK.REP5.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



432  

433  proc export data = rep5

434  outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\esg_qtr_sale.dta"

435  dbms = '' replace;

436  run;



NOTE: The export data set has 89196 observations and 44 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\esg_qtr_sale.dta" file was 

      successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           0.07 seconds

      cpu time            0.04 seconds

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           6:15:35.58

      cpu time            11:58.78

      



===== 8_Ind_ESG_Distri.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



12   

13   /**************1. Industry distribution**************/

14   proc import out = newsday

15   datafile = "H:\project\ESG News and Customer\Data\ticnewsdate1013.dta"

16   dbms = '' replace;

17   run;



NOTE: One or more variables were converted because the data type is not supported by the V9 

      engine. For more details, run with options MSGLEVEL=I.

NOTE: The import data set has 2735 observations and 13 variables.

NOTE: WORK.NEWSDAY data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



18   

19   proc sort data = newsday nodupkey out = ind;

20   by tic naics2;

21   run;



NOTE: There were 2735 observations read from the data set WORK.NEWSDAY.

NOTE: 2484 observations with duplicate key values were deleted.

NOTE: The data set WORK.IND has 251 observations and 13 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



22   

23   proc freq data = ind; tables naics2; run;



NOTE: There were 251 observations read from the data set WORK.IND.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



24   

25   

26   

27   /***********2. E, S, G distribution***********/

28   libname reprisk "F:\bdata\RepRisk";

NOTE: Libref REPRISK was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: F:\bdata\RepRisk

28 !                                     run;

29   

30   data newsdata2;

31   set reprisk.repriskus2017_2020;

32   if index(related_countries,'United States of America') ge 1 then USnews=1;

33   if index(source_language,'English') ge 1 then news_english=1;

34   cusip6=substr(ISIN,3,6);

35   if news_date > '10JAN2018'd;

36   if news_date < '12DEC2020'd;

37   run;



NOTE: There were 6738982 observations read from the data set REPRISK.REPRISKUS2017_2020.

NOTE: The data set WORK.NEWSDATA2 has 4827033 observations and 18 variables.

NOTE: DATA statement used (Total process time):

      real time           7:36.88

      cpu time            59.03 seconds

      



38   

39   /*dropping duplications*/

40   proc sort nodupkey data=newsdata2 out=newsdata4;

41   by cusip6 news_date reprisk_story_id reprisk_substory_id;

42   run;



NOTE: There were 4827033 observations read from the data set WORK.NEWSDATA2.

NOTE: 4650247 observations with duplicate key values were deleted.

NOTE: The data set WORK.NEWSDATA4 has 176786 observations and 18 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           16.72 seconds

      cpu time            14.34 seconds

      



43   

44   /*************construct E S G issues*****************/

45   data newsdata4;

46   set newsdata4;

47   

48   

49   if kindex(related_issues,"Climate change")>0 then do; d_issue1=1; class1 = 1;  end;

50   if kindex(related_issues,"Other environmental issues")>0 then do; d_issue1=1; class2=1; end;

51   if kindex(related_issues,"Waste issues")>0 then do; d_issue1=1; class3 = 1; end;

52   if kindex(related_issues,"Overuse and wasting of resources")>0 then do; d_issue1=1; class4 =

52 ! 1; end;

53   if kindex(related_issues,"Impacts on landscapes, ecosystems and biodiversity")>0 then do;

53 ! d_issue1=1; class5=1; end;

54   if kindex(related_issues,"Local pollution")>0 then do; d_issue1=1; class6 = 1; end;

55   if kindex(related_issues,"Animal mistreatment")>0 then do; d_issue1=1; class7 = 1; end;

56   if d_issue1=. then d_issue1=0;

57   

58   

59   if kindex(related_issues,"Child labor")>0 then do; d_issue2=1; class8 = 1; end;

60   if kindex(related_issues,"Discrimination in employment")>0 then do; d_issue2=1; class9 = 1;

60 ! end;

61   if kindex(related_issues,"Forced labor")>0 then do; d_issue2=1; class10 = 1; end;

62   if kindex(related_issues,"Human rights abuses and corporate complicity")>0 then do;

62 ! d_issue2=1; class11 = 1; end;

63   if kindex(related_issues,"Freedom of association and collective bargaining")>0 then do;

63 ! d_issue2=1; class12 = 1; end;

64   if kindex(related_issues,"Impacts on communities")>0 then do; d_issue2=1; class13 = 1; end;

65   if kindex(related_issues,"Local participation issues")>0 then do; d_issue2=1; class14 = 1;

65 ! end;

66   if kindex(related_issues,"Occupational health and safety issues")>0 then do; d_issue2=1;

66 ! class15 = 1; end;

67   if kindex(related_issues,"Other social issues")>0 then do; d_issue2=1; class16 = 1; end;

68   if kindex(related_issues,"Poor employment conditions")>0 then do; d_issue2=1; class17 = 1;

68 ! end;

69   if kindex(related_issues,"Social discrimination")>0 then do; d_issue2=1; class18 = 1; end;

70   if d_issue2=. then d_issue2=0;

71   

72   

73   if kindex(related_issues,"Anti-competitive practices")>0 then do; d_issue3=1; class19 = 1;

73 ! end;

74   if kindex(related_issues,"Corruption, bribery, extortion and money laundering")>0 then do;

74 ! d_issue3=1; class20 = 1; end;

75   if kindex(related_issues,"Executive compensation issues")>0 then do; d_issue3=1; class21 = 1;

75 !  end;

76   if kindex(related_issues,"Fraud")>0 then do; d_issue3=1; class22 = 1; end;

77   if kindex(related_issues,"Misleading communication")>0 then do; d_issue3=1; class23 = 1; end;

78   if kindex(related_issues,"Tax evasion")>0 then do; d_issue3=1; class24 = 1; end;

79   if kindex(related_issues,"Tax optimization")>0 then do; d_issue3=1; class25 = 1; end;

80   if kindex(related_issues,"Other issues")>0 then do; d_issue3=1; class26 = 1; end;

81   if d_issue3=. then d_issue3=0;

82   

83   if kindex(related_issues,"Products (health and environmental issues")>0 then class27 = 1;

84   if kindex(related_issues,"Controversial products and services")>0 then class28 = 1;

85   if kindex(related_issues,"Supply chain issues")>0 then class29 = 1;

86   if kindex(related_issues,"Violation of international standards")>0 then class30 = 1;

87   if kindex(related_issues,"Violation of national legislation")>0 then  class31 = 1;

88   

89   

90   run;



NOTE: There were 176786 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4 has 176786 observations and 52 variables.

NOTE: DATA statement used (Total process time):

      real time           3.69 seconds

      cpu time            3.54 seconds

      



91   

92   

93   /*****Get highest news category, novelty, reach, severity per news date****/

94   proc sort data = newsdata4;

95   by cusip6 news_date;

96   run;



NOTE: There were 176786 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4 has 176786 observations and 52 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           2.22 seconds

      cpu time            2.93 seconds

      



97   

98   proc means data = newsdata4 noprint;

99   by cusip6 news_date;

100  var d_issue1 d_issue2 d_issue3  severity novelty reach ;

101  output out=newsdata4_2(drop=_type_ _freq_)

102  max=md_issue1 md_issue2 md_issue3 mcrosscutting mseverity mnovelty mreach ;

103  run;



NOTE: There were 176786 observations read from the data set WORK.NEWSDATA4.

NOTE: The data set WORK.NEWSDATA4_2 has 127005 observations and 8 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.69 seconds

      cpu time            0.64 seconds

      



104  

105  /*****Import Compustat********/

106  libname data "H:\project\ESG News and Customer\Data";

NOTE: Libref DATA was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: H:\project\ESG News and Customer\Data

106!                                                       run;

107  

108  data qcompustat;

109  set data.compustat_quarter;

110  if atq>0;

111  if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

112  MVEQ=(PRCCQ*CSHOQ);

113  MTBQ=MVEQ/CEQQ;

114  BTMQ=CEQQ/MVEQ;

115  lnMVEQ=log(MVEQ);

116  lnATQ=log(ATQ);

117  *LEVQ=(DLTTQ+DLCQ)/ATQ;

118  *LEV_MVEQ=(DLTTQ+DLCQ)/MVEQ;

119  Leverageq=LTQ/ATQ;

120  IBQ_ATQ=IBQ/ATQ;

121  if IBQ<0 and IBQ ne . then Loss=1;

122  if IBQ>=0 and IBQ ne . then Loss=0;

123  lnsaleq=log(1+saleq);

124  run;



NOTE: Invalid argument to function LOG(-0.198) at line 123 column 9.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=ACMTA cusip=004616207 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=30APR2020 atq=55.544

ceqq=28.126 cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639 lctq=. ltq=27.418 saleq=-1.198

seqq=28.126 teqq=28.126 txdbq=0 capxy=0.015 exchg=19 costat=A prccq=32.3 sic=6351 MVEQ=25.6462

MTBQ=0.9118324682 BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995 Leverageq=0.4936266743

IBQ_ATQ=-0.029508138 Loss=1 lnsaleq=. _ERROR_=1 _N_=243

NOTE: Invalid argument to function LOG(-0.091) at line 123 column 9.

gvkey=001790 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=AB. cusip=043420108 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=26JUN2020 atq=29.565

ceqq=-20.591 cheq=2.976 chq=0.187 cshoq=2.837 ibq=-0.318 lctq=4.728 ltq=50.156 saleq=-1.091

seqq=-20.591 teqq=-20.591 txdbq=0.324 capxy=0.002 exchg=9 costat=A prccq=0.35 sic=6799

MVEQ=0.99295 MTBQ=-0.048222524 BTMQ=-20.73719724 lnMVEQ=-0.007074969 lnATQ=3.3865912293

Leverageq=1.6964654152 IBQ_ATQ=-0.010755961 Loss=1 lnsaleq=. _ERROR_=1 _N_=1691

NOTE: Invalid argument to function LOG(-9009) at line 123 column 9.

gvkey=002176 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=BRK.B cusip=084670702 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=02MAY2020 atq=760448

ceqq=371565 cheq=144480 chq=42640 cshoq=2430.035 ibq=-49746 lctq=. ltq=385213 saleq=-9010

seqq=371565 teqq=375235 txdbq=. capxy=2968 exchg=11 costat=A prccq=182.83 sic=9997

MVEQ=444283.29905 MTBQ=1.1957081508 BTMQ=0.8363244821 lnMVEQ=13.004217699 lnATQ=13.541663012

Leverageq=0.5065606064 IBQ_ATQ=-0.065416702 Loss=1 lnsaleq=. _ERROR_=1 _N_=2441

NOTE: Invalid argument to function LOG(-4.5) at line 123 column 9.

gvkey=011729 datadate=31DEC2016 fyearq=2016 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=WTM cusip=G9618E107 curcdq=USD datacqtr=2016Q4 datafqtr=2016Q4 rdq=07FEB2017 atq=6544.7

ceqq=3603.3 cheq=650.1 chq=149.8 cshoq=4.564 ibq=-46.9 lctq=. ltq=2807.5 saleq=-5.5 seqq=3603.3

teqq=3737.2 txdbq=0 capxy=4.3 exchg=11 costat=A prccq=836.05 sic=6351 MVEQ=3815.7322

MTBQ=1.0589549025 BTMQ=0.9443272775 lnMVEQ=8.2468878519 lnATQ=8.7864108408 Leverageq=0.4289730622

IBQ_ATQ=-0.007166104 Loss=1 lnsaleq=. _ERROR_=1 _N_=21894

NOTE: Invalid argument to function LOG(-69.6) at line 123 column 9.

gvkey=011729 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=WTM cusip=G9618E107 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=3739.7

ceqq=3076.7 cheq=274 chq=136.4 cshoq=3.135 ibq=-129.7 lctq=. ltq=780.6 saleq=-70.6 seqq=3076.7

teqq=2959.1 txdbq=. capxy=0 exchg=11 costat=A prccq=910 sic=6351 MVEQ=2852.85 MTBQ=0.9272434752

BTMQ=1.0784653943 lnMVEQ=7.9560737736 lnATQ=8.2267606733 Leverageq=0.2087333209

IBQ_ATQ=-0.034681926 Loss=1 lnsaleq=. _ERROR_=1 _N_=21907

NOTE: Invalid argument to function LOG(-1.058) at line 123 column 9.

gvkey=011957 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=TOF.U cusip=87725P105 curcdq=CAD datacqtr=2018Q2 datafqtr=2018Q2 rdq=20AUG2018 atq=14.763

ceqq=13.986 cheq=14.721 chq=0.261 cshoq=1.411 ibq=-2.336 lctq=0.777 ltq=0.777 saleq=-2.058

seqq=13.986 teqq=13.986 txdbq=0 capxy=0 exchg=7 costat=I prccq=10.97 sic=6199 MVEQ=15.47867

MTBQ=1.1067260117 BTMQ=0.9035660041 lnMVEQ=2.7394629472 lnATQ=2.6921240506 Leverageq=0.0526315789

IBQ_ATQ=-0.158233421 Loss=1 lnsaleq=. _ERROR_=1 _N_=22530

NOTE: Invalid argument to function LOG(-28) at line 123 column 9.

gvkey=013561 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=MBI cusip=55262C100 curcdq=USD datacqtr=2018Q2 datafqtr=2018Q2 rdq=08AUG2018 atq=8699

ceqq=1103 cheq=675 chq=197 cshoq=90.662 ibq=-146 lctq=. ltq=7584 saleq=-29 seqq=1103 teqq=1115

txdbq=0 capxy=0 exchg=11 costat=A prccq=9.04 sic=6351 MVEQ=819.58448 MTBQ=0.7430502992

BTMQ=1.3458039127 lnMVEQ=6.7087974801 lnATQ=9.0709633555 Leverageq=0.8718243476

IBQ_ATQ=-0.016783538 Loss=1 lnsaleq=. _ERROR_=1 _N_=26114

NOTE: Invalid argument to function LOG(-42) at line 123 column 9.

gvkey=013709 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=IEP cusip=451100101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=24306

ceqq=3635 cheq=3257 chq=2381 cshoq=214.186 ibq=-1384 lctq=. ltq=14889 saleq=-43 seqq=3635

teqq=9417 txdbq=533 capxy=53 exchg=14 costat=A prccq=48.42 sic=9997 MVEQ=10370.88612

MTBQ=2.8530635818 BTMQ=0.3505004257 lnMVEQ=9.2467577479 lnATQ=10.098478512 Leverageq=0.6125647988

IBQ_ATQ=-0.056940673 Loss=1 lnsaleq=. _ERROR_=1 _N_=26550

NOTE: Invalid argument to function LOG(-989) at line 123 column 9.

gvkey=014326 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=ONEXF cusip=68272K103 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=15MAY2020 atq=6184

ceqq=5904 cheq=813 chq=379 cshoq=99.159 ibq=-997 lctq=. ltq=280 saleq=-990 seqq=5904 teqq=5904

txdbq=. capxy=0 exchg=19 costat=A prccq=. sic=6799 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=8.7297205903 Leverageq=0.0452781371 IBQ_ATQ=-0.16122251 Loss=1 lnsaleq=. _ERROR_=1 _N_=28182

NOTE: Invalid argument to function LOG(-98) at line 123 column 9.

gvkey=014824 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=CINF cusip=172062101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=27APR2020 atq=23367

ceqq=8042 cheq=988 chq=486 cshoq=160.8 ibq=-1226 lctq=. ltq=15325 saleq=-99 seqq=8042 teqq=8042

txdbq=660 capxy=4 exchg=14 costat=A prccq=75.45 sic=6331 MVEQ=12132.36 MTBQ=1.5086247202

BTMQ=0.6628553719 lnMVEQ=9.403631542 lnATQ=10.05908005 Leverageq=0.6558394317 IBQ_ATQ=-0.052467155

Loss=1 lnsaleq=. _ERROR_=1 _N_=30164

NOTE: Invalid argument to function LOG(-69.092) at line 123 column 9.

gvkey=015082 datadate=31MAR2016 fyearq=2016 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=SVCTF cusip=81731L109 curcdq=CAD datacqtr=2016Q1 datafqtr=2016Q1 rdq=13MAY2016 atq=1870.033

ceqq=676.583 cheq=8.444 chq=7.986 cshoq=2.817 ibq=-54.83 lctq=. ltq=1125.576 saleq=-70.092

seqq=676.583 teqq=744.457 txdbq=13.752 capxy=0 exchg=19 costat=A prccq=125.77 sic=6799

MVEQ=354.29409 MTBQ=0.5236520723 BTMQ=1.909664934 lnMVEQ=5.870127331 lnATQ=7.5337113568

Leverageq=0.6019016777 IBQ_ATQ=-0.029320338 Loss=1 lnsaleq=. _ERROR_=1 _N_=31037

NOTE: Invalid argument to function LOG(-189.836) at line 123 column 9.

gvkey=015082 datadate=31DEC2018 fyearq=2018 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=SVCTF cusip=81731L109 curcdq=CAD datacqtr=2018Q4 datafqtr=2018Q4 rdq=29MAR2019 atq=2756.97

ceqq=864.636 cheq=121.017 chq=120.555 cshoq=2.689 ibq=-152.197 lctq=. ltq=1787.549 saleq=-190.836

seqq=864.636 teqq=969.421 txdbq=25.782 capxy=0 exchg=19 costat=A prccq=161.01 sic=6799

MVEQ=432.95589 MTBQ=0.5007377555 BTMQ=1.9970533257 lnMVEQ=6.0706358521 lnATQ=7.9218875296

Leverageq=0.6483744836 IBQ_ATQ=-0.055204445 Loss=1 lnsaleq=. _ERROR_=1 _N_=31048

NOTE: Invalid argument to function LOG(-37.16) at line 123 column 9.

gvkey=015082 datadate=30JUN2019 fyearq=2019 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=SVCTF cusip=81731L109 curcdq=CAD datacqtr=2019Q2 datafqtr=2019Q2 rdq=12AUG2019 atq=2548.264

ceqq=825.661 cheq=18.074 chq=17.609 cshoq=2.676 ibq=-56.555 lctq=. ltq=1704.613 saleq=-38.16

seqq=825.661 teqq=843.651 txdbq=22.483 capxy=0 exchg=19 costat=A prccq=168.61 sic=6799

MVEQ=451.20036 MTBQ=0.5464716875 BTMQ=1.829920969 lnMVEQ=6.1119114981 lnATQ=7.843167622

Leverageq=0.6689310841 IBQ_ATQ=-0.02219354 Loss=1 lnsaleq=. _ERROR_=1 _N_=31050

NOTE: Invalid argument to function LOG(-350.373) at line 123 column 9.

gvkey=015082 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=SVCTF cusip=81731L109 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=1980.88

ceqq=639.374 cheq=17.261 chq=16.796 cshoq=2.634 ibq=-341.993 lctq=. ltq=1325.132 saleq=-351.373

seqq=639.374 teqq=655.748 txdbq=25.959 capxy=0 exchg=19 costat=A prccq=109.99 sic=6799

MVEQ=289.71366 MTBQ=0.4531208025 BTMQ=2.2069169952 lnMVEQ=5.6688930559 lnATQ=7.5912964694

Leverageq=0.6689612697 IBQ_ATQ=-0.172647005 Loss=1 lnsaleq=. _ERROR_=1 _N_=31053

NOTE: Invalid argument to function LOG(-222.641) at line 123 column 9.

gvkey=015101 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=MFA cusip=55272X102 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=16JUN2020 atq=11130.337

ceqq=2440.485 cheq=333.367 chq=116.465 cshoq=453.138 ibq=-908.995 lctq=. ltq=8689.662

saleq=-223.641 seqq=2440.675 teqq=2440.675 txdbq=0 capxy=0 exchg=11 costat=A prccq=1.55 sic=6798

MVEQ=702.3639 MTBQ=0.2877968519 BTMQ=3.4746731716 lnMVEQ=6.5544516458 lnATQ=9.3174297223

Leverageq=0.780718679 IBQ_ATQ=-0.081668237 Loss=1 lnsaleq=. _ERROR_=1 _N_=31193

NOTE: Invalid argument to function LOG(-33.625) at line 123 column 9.

gvkey=015452 datadate=30JUN2016 fyearq=2016 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=LNCOQ cusip=535782106 curcdq=USD datacqtr=2016Q2 datafqtr=2016Q2 rdq=05AUG2016 atq=17.55

ceqq=4.35 cheq=0.847 chq=0.847 cshoq=244.247 ibq=-35.485 lctq=13.2 ltq=13.2 saleq=-34.625

seqq=4.35 teqq=4.35 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.072 sic=1311 MVEQ=17.585784

MTBQ=4.0427089655 BTMQ=0.2473588894 lnMVEQ=2.8670908484 lnATQ=2.8650539499 Leverageq=0.7521367521

IBQ_ATQ=-2.021937322 Loss=1 lnsaleq=. _ERROR_=1 _N_=32451

NOTE: Invalid argument to function LOG(-9.899) at line 123 column 9.

gvkey=015452 datadate=30SEP2016 fyearq=2016 fqtr=3 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=LNCOQ cusip=535782106 curcdq=USD datacqtr=2016Q3 datafqtr=2016Q3 rdq=07NOV2016 atq=6.323

ceqq=-5.13 cheq=0.847 chq=0.847 cshoq=251.645 ibq=-10.927 lctq=11.453 ltq=11.453 saleq=-10.899

seqq=-5.13 teqq=-5.13 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.045 sic=1311 MVEQ=11.324025

MTBQ=-2.207412281 BTMQ=-0.453019134 lnMVEQ=2.4269265749 lnATQ=1.8441937791 Leverageq=1.8113237387

IBQ_ATQ=-1.728135379 Loss=1 lnsaleq=. _ERROR_=1 _N_=32452

NOTE: Invalid argument to function LOG(-4.947) at line 123 column 9.

gvkey=016187 datadate=31MAR2017 fyearq=2017 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=6120B cusip=282645936 curcdq=USD datacqtr=2017Q1 datafqtr=2017Q1 rdq=04MAY2017 atq=3852.675

ceqq=806.124 cheq=1475.115 chq=115.677 cshoq=0.264 ibq=-17.725 lctq=. ltq=3046.551 saleq=-5.947

seqq=806.124 teqq=806.124 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=.

lnMVEQ=. lnATQ=8.2565229912 Leverageq=0.7907625221 IBQ_ATQ=-0.0046007 Loss=1 lnsaleq=. _ERROR_=1

_N_=34057

NOTE: Invalid argument to function LOG(-2.939) at line 123 column 9.

gvkey=016187 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=6120B cusip=282645936 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=06MAY2020 atq=1484.296

ceqq=667.972 cheq=909.717 chq=131.826 cshoq=0.264 ibq=-7.591 lctq=. ltq=816.324 saleq=-3.939

seqq=667.972 teqq=667.972 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=.

lnMVEQ=. lnATQ=7.3026958648 Leverageq=0.5499738597 IBQ_ATQ=-0.005114209 Loss=1 lnsaleq=. _ERROR_=1

_N_=34069

NOTE: Invalid argument to function LOG(-1956) at line 123 column 9.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=016384 datadate=31MAR2021 fyearq=2021 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=VOYA cusip=929089100 curcdq=USD datacqtr=2021Q1 datafqtr=2021Q1 rdq=10MAY2021 atq=162861

ceqq=7931 cheq=3182 chq=1316 cshoq=121.222 ibq=1086 lctq=. ltq=153862 saleq=-1957 seqq=7931

teqq=8999 txdbq=0 capxy=0 exchg=11 costat=A prccq=63.64 sic=6311 MVEQ=7714.56808 MTBQ=0.9727106393

BTMQ=1.0280549627 lnMVEQ=8.9508657788 lnATQ=12.000652355 Leverageq=0.9447442911

IBQ_ATQ=0.0066682631 Loss=0 lnsaleq=. _ERROR_=1 _N_=34258

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      12941 at 112:12   13505 at 113:10   13505 at 114:10   12941 at 115:8    155 at 119:14

      624 at 120:12     1478 at 123:9     1478 at 123:14    

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 113:10   1 at 114:10    1 at 115:8     243 at 123:9   

NOTE: There were 251509 observations read from the data set DATA.COMPUSTAT_QUARTER.

NOTE: The data set WORK.QCOMPUSTAT has 167464 observations and 40 variables.

NOTE: DATA statement used (Total process time):

      real time           0.23 seconds

      cpu time            0.06 seconds

      



125  

126  proc sort nodupkey data=qcompustat; by gvkey datadate; run;



NOTE: There were 167464 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 93 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 40 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.11 seconds

      cpu time            0.14 seconds

      



127  

128  data qcompustat;

129  set qcompustat;

130  cusip6=substr(cusip,1,6);

131  lagCAPXY=lag(CAPXY);

132  if lag(gvkey) ne gvkey or 93<datadate-lag(datadate) or datadate-lag(datadate)<0 or

132! fqtr-lag(fqtr) ne 1 then lagCAPXY=.;

133  if fqtr=1 then CAPXQ=CAPXY;

134  if fqtr=2 or fqtr=3 or fqtr=4 then CAPXQ=CAPXY-lagCAPXY;

135  CAPXQ_AT=CAPXQ/ATQ;

136  run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 132:38       1 at 132:64       86 at 132:88      13800 at 134:47   15705 at 135:15

NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: DATA statement used (Total process time):

      real time           0.07 seconds

      cpu time            0.06 seconds

      



137  

138  proc sort data = qcompustat; by cusip6 datadate descending atq; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.13 seconds

      cpu time            0.11 seconds

      



139  

140  proc sort data = qcompustat nodupkey; by cusip6 datadate; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 266 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.14 seconds

      cpu time            0.15 seconds

      



141  

142  /**************2.1 All reprisk news*************/

143  /*****Merge reprisk with datadate****/

144  proc sql;

145  create table repsample as

146  select a.*, b.tic, b.datadate, b.gvkey

147  from newsdata4_2 as a, qcompustat as b

148  where (a.cusip6 = b.cusip6) and (a.news_date-93)<b.datadate<a.news_date

149  order by a.cusip6, a.news_date, b.datadate desc;

NOTE: Table WORK.REPSAMPLE created, with 34220 rows and 11 columns.



150  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.12 seconds

      cpu time            0.09 seconds

      



151  

152  proc sort nodupkey data=repsample; by cusip6 news_date; run;



NOTE: There were 34220 observations read from the data set WORK.REPSAMPLE.

NOTE: 311 observations with duplicate key values were deleted.

NOTE: The data set WORK.REPSAMPLE has 33909 observations and 11 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



153  

154  data repsample;

155  set repsample;

156  if tic = "" then delete;

157  run;



NOTE: There were 33909 observations read from the data set WORK.REPSAMPLE.

NOTE: The data set WORK.REPSAMPLE has 33909 observations and 11 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



158  

159  /****merge back to get detailed classification****/

160  proc sql;

161  create table repsample2 as select a.*, b.tic, b.gvkey, b.datadate

162  from newsdata4 as a, repsample as b

163  where a.cusip6 = b.cusip6

164  and a.news_date = b.news_date

165  order by cusip6, news_date;

NOTE: Table WORK.REPSAMPLE2 created, with 47618 rows and 55 columns.



166  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.57 seconds

      cpu time            0.54 seconds

      



167  

168  

169  proc means data=repsample2 noprint;

170  var class1--class31;

171  output out=rep_all(drop=_type_ _freq_) sum=;

172  run;



NOTE: There were 47618 observations read from the data set WORK.REPSAMPLE2.

NOTE: The data set WORK.REP_ALL has 1 observations and 33 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.11 seconds

      cpu time            0.14 seconds

      



173  

174  

175  /**************2.2 in our sample reprisk news*************/

176  data newsday;

177  set newsday;

178  insample = 1;

179  run;



NOTE: There were 2735 observations read from the data set WORK.NEWSDAY.

NOTE: The data set WORK.NEWSDAY has 2735 observations and 14 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.01 seconds

      



180  

181  proc sql;

182  create table repsample3 as select

183  a.*, b.insample

184  from repsample2 as a, newsday as b

185  where a.cusip6 = b.cusip6

186  and a.news_date = b.news_date

187  order by cusip6, news_date;

NOTE: Table WORK.REPSAMPLE3 created, with 3567 rows and 56 columns.



188  quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.12 seconds

      cpu time            0.12 seconds

      



189  

190  proc means data=repsample3 noprint;

191  var class1--class31;

192  output out=rep_in(drop=_type_ _freq_) sum=;

193  run;



NOTE: There were 3567 observations read from the data set WORK.REPSAMPLE3.

NOTE: The data set WORK.REP_IN has 1 observations and 33 variables.

NOTE: PROCEDURE MEANS used (Total process time):

      real time           0.01 seconds

      cpu time            0.03 seconds

      



194  

195  

196  proc export data=rep_all

197  outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\esgfreq.xlsx"

198  dbms = xlsx replace;

199  sheet = "full sample";

200  run;



NOTE: The export data set has 1 observations and 33 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\esgfreq.xlsx" file was 

      successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           0.38 seconds

      cpu time            0.00 seconds

      



201  

202  

203  proc export data=rep_in

204  outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and Output\esgfreq.xlsx"

205  dbms = xlsx replace;

206  sheet = "reg sample";

207  run;



NOTE: The export data set has 1 observations and 33 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\esgfreq.xlsx" file was 

      successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           0.31 seconds

      cpu time            0.03 seconds

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           3:18:20.33

      cpu time            3:05.03

      



===== 9_Compustat_Compare.txt =====
NOTE: PROCEDURE PRINTTO used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



2    

3    libname data "H:\project\ESG News and Customer\Data";

NOTE: Libref DATA was successfully assigned as follows: 

      Engine:        V9 

      Physical Name: H:\project\ESG News and Customer\Data

3  !                                                       run;

4    

5    /*************1. Import Compustat data to merge with RepRisk***********/

6    data qcompustat;

7    set data.compustat_quarter;

8    if atq>0;

9    if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

10   MVEQ=(PRCCQ*CSHOQ);

11   MTBQ=MVEQ/CEQQ;

12   BTMQ=CEQQ/MVEQ;

13   lnMVEQ=log(MVEQ);

14   lnATQ=log(ATQ);

15   *LEVQ=(DLTTQ+DLCQ)/ATQ;

16   *LEV_MVEQ=(DLTTQ+DLCQ)/MVEQ;

17   Leverageq=LTQ/ATQ;

18   IBQ_ATQ=IBQ/ATQ;

19   if IBQ<0 and IBQ ne . then Loss=1;

20   if IBQ>=0 and IBQ ne . then Loss=0;

21   lnsaleq=log(1+saleq);

22   run;



NOTE: Invalid argument to function LOG(-0.198) at line 21 column 9.

gvkey=001097 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=ACMTA cusip=004616207 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=30APR2020 atq=55.544

ceqq=28.126 cheq=14.883 chq=2.498 cshoq=0.794 ibq=-1.639 lctq=. ltq=27.418 saleq=-1.198

seqq=28.126 teqq=28.126 txdbq=0 capxy=0.015 exchg=19 costat=A prccq=32.3 sic=6351 MVEQ=25.6462

MTBQ=0.9118324682 BTMQ=1.0966926874 lnMVEQ=3.2443954125 lnATQ=4.0171754995 Leverageq=0.4936266743

IBQ_ATQ=-0.029508138 Loss=1 lnsaleq=. _ERROR_=1 _N_=243

NOTE: Invalid argument to function LOG(-0.091) at line 21 column 9.

gvkey=001790 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=AB. cusip=043420108 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=26JUN2020 atq=29.565

ceqq=-20.591 cheq=2.976 chq=0.187 cshoq=2.837 ibq=-0.318 lctq=4.728 ltq=50.156 saleq=-1.091

seqq=-20.591 teqq=-20.591 txdbq=0.324 capxy=0.002 exchg=9 costat=A prccq=0.35 sic=6799

MVEQ=0.99295 MTBQ=-0.048222524 BTMQ=-20.73719724 lnMVEQ=-0.007074969 lnATQ=3.3865912293

Leverageq=1.6964654152 IBQ_ATQ=-0.010755961 Loss=1 lnsaleq=. _ERROR_=1 _N_=1691

NOTE: Invalid argument to function LOG(-9009) at line 21 column 9.

gvkey=002176 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=BRK.B cusip=084670702 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=02MAY2020 atq=760448

ceqq=371565 cheq=144480 chq=42640 cshoq=2430.035 ibq=-49746 lctq=. ltq=385213 saleq=-9010

seqq=371565 teqq=375235 txdbq=. capxy=2968 exchg=11 costat=A prccq=182.83 sic=9997

MVEQ=444283.29905 MTBQ=1.1957081508 BTMQ=0.8363244821 lnMVEQ=13.004217699 lnATQ=13.541663012

Leverageq=0.5065606064 IBQ_ATQ=-0.065416702 Loss=1 lnsaleq=. _ERROR_=1 _N_=2441

NOTE: Invalid argument to function LOG(-4.5) at line 21 column 9.

gvkey=011729 datadate=31DEC2016 fyearq=2016 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=WTM cusip=G9618E107 curcdq=USD datacqtr=2016Q4 datafqtr=2016Q4 rdq=07FEB2017 atq=6544.7

ceqq=3603.3 cheq=650.1 chq=149.8 cshoq=4.564 ibq=-46.9 lctq=. ltq=2807.5 saleq=-5.5 seqq=3603.3

teqq=3737.2 txdbq=0 capxy=4.3 exchg=11 costat=A prccq=836.05 sic=6351 MVEQ=3815.7322

MTBQ=1.0589549025 BTMQ=0.9443272775 lnMVEQ=8.2468878519 lnATQ=8.7864108408 Leverageq=0.4289730622

IBQ_ATQ=-0.007166104 Loss=1 lnsaleq=. _ERROR_=1 _N_=21894

NOTE: Invalid argument to function LOG(-69.6) at line 21 column 9.

gvkey=011729 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=WTM cusip=G9618E107 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=3739.7

ceqq=3076.7 cheq=274 chq=136.4 cshoq=3.135 ibq=-129.7 lctq=. ltq=780.6 saleq=-70.6 seqq=3076.7

teqq=2959.1 txdbq=. capxy=0 exchg=11 costat=A prccq=910 sic=6351 MVEQ=2852.85 MTBQ=0.9272434752

BTMQ=1.0784653943 lnMVEQ=7.9560737736 lnATQ=8.2267606733 Leverageq=0.2087333209

IBQ_ATQ=-0.034681926 Loss=1 lnsaleq=. _ERROR_=1 _N_=21907

NOTE: Invalid argument to function LOG(-1.058) at line 21 column 9.

gvkey=011957 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=TOF.U cusip=87725P105 curcdq=CAD datacqtr=2018Q2 datafqtr=2018Q2 rdq=20AUG2018 atq=14.763

ceqq=13.986 cheq=14.721 chq=0.261 cshoq=1.411 ibq=-2.336 lctq=0.777 ltq=0.777 saleq=-2.058

seqq=13.986 teqq=13.986 txdbq=0 capxy=0 exchg=7 costat=I prccq=10.97 sic=6199 MVEQ=15.47867

MTBQ=1.1067260117 BTMQ=0.9035660041 lnMVEQ=2.7394629472 lnATQ=2.6921240506 Leverageq=0.0526315789

IBQ_ATQ=-0.158233421 Loss=1 lnsaleq=. _ERROR_=1 _N_=22530

NOTE: Invalid argument to function LOG(-28) at line 21 column 9.

gvkey=013561 datadate=30JUN2018 fyearq=2018 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=MBI cusip=55262C100 curcdq=USD datacqtr=2018Q2 datafqtr=2018Q2 rdq=08AUG2018 atq=8699

ceqq=1103 cheq=675 chq=197 cshoq=90.662 ibq=-146 lctq=. ltq=7584 saleq=-29 seqq=1103 teqq=1115

txdbq=0 capxy=0 exchg=11 costat=A prccq=9.04 sic=6351 MVEQ=819.58448 MTBQ=0.7430502992

BTMQ=1.3458039127 lnMVEQ=6.7087974801 lnATQ=9.0709633555 Leverageq=0.8718243476

IBQ_ATQ=-0.016783538 Loss=1 lnsaleq=. _ERROR_=1 _N_=26114

NOTE: Invalid argument to function LOG(-42) at line 21 column 9.

gvkey=013709 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=IEP cusip=451100101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=24306

ceqq=3635 cheq=3257 chq=2381 cshoq=214.186 ibq=-1384 lctq=. ltq=14889 saleq=-43 seqq=3635

teqq=9417 txdbq=533 capxy=53 exchg=14 costat=A prccq=48.42 sic=9997 MVEQ=10370.88612

MTBQ=2.8530635818 BTMQ=0.3505004257 lnMVEQ=9.2467577479 lnATQ=10.098478512 Leverageq=0.6125647988

IBQ_ATQ=-0.056940673 Loss=1 lnsaleq=. _ERROR_=1 _N_=26550

NOTE: Invalid argument to function LOG(-989) at line 21 column 9.

gvkey=014326 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=ONEXF cusip=68272K103 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=15MAY2020 atq=6184

ceqq=5904 cheq=813 chq=379 cshoq=99.159 ibq=-997 lctq=. ltq=280 saleq=-990 seqq=5904 teqq=5904

txdbq=. capxy=0 exchg=19 costat=A prccq=. sic=6799 MVEQ=. MTBQ=. BTMQ=. lnMVEQ=.

lnATQ=8.7297205903 Leverageq=0.0452781371 IBQ_ATQ=-0.16122251 Loss=1 lnsaleq=. _ERROR_=1 _N_=28182

NOTE: Invalid argument to function LOG(-98) at line 21 column 9.

gvkey=014824 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=CINF cusip=172062101 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=27APR2020 atq=23367

ceqq=8042 cheq=988 chq=486 cshoq=160.8 ibq=-1226 lctq=. ltq=15325 saleq=-99 seqq=8042 teqq=8042

txdbq=660 capxy=4 exchg=14 costat=A prccq=75.45 sic=6331 MVEQ=12132.36 MTBQ=1.5086247202

BTMQ=0.6628553719 lnMVEQ=9.403631542 lnATQ=10.05908005 Leverageq=0.6558394317 IBQ_ATQ=-0.052467155

Loss=1 lnsaleq=. _ERROR_=1 _N_=30164

NOTE: Invalid argument to function LOG(-69.092) at line 21 column 9.

gvkey=015082 datadate=31MAR2016 fyearq=2016 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=SVCTF cusip=81731L109 curcdq=CAD datacqtr=2016Q1 datafqtr=2016Q1 rdq=13MAY2016 atq=1870.033

ceqq=676.583 cheq=8.444 chq=7.986 cshoq=2.817 ibq=-54.83 lctq=. ltq=1125.576 saleq=-70.092

seqq=676.583 teqq=744.457 txdbq=13.752 capxy=0 exchg=19 costat=A prccq=125.77 sic=6799

MVEQ=354.29409 MTBQ=0.5236520723 BTMQ=1.909664934 lnMVEQ=5.870127331 lnATQ=7.5337113568

Leverageq=0.6019016777 IBQ_ATQ=-0.029320338 Loss=1 lnsaleq=. _ERROR_=1 _N_=31037

NOTE: Invalid argument to function LOG(-189.836) at line 21 column 9.

gvkey=015082 datadate=31DEC2018 fyearq=2018 fqtr=4 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=SVCTF cusip=81731L109 curcdq=CAD datacqtr=2018Q4 datafqtr=2018Q4 rdq=29MAR2019 atq=2756.97

ceqq=864.636 cheq=121.017 chq=120.555 cshoq=2.689 ibq=-152.197 lctq=. ltq=1787.549 saleq=-190.836

seqq=864.636 teqq=969.421 txdbq=25.782 capxy=0 exchg=19 costat=A prccq=161.01 sic=6799

MVEQ=432.95589 MTBQ=0.5007377555 BTMQ=1.9970533257 lnMVEQ=6.0706358521 lnATQ=7.9218875296

Leverageq=0.6483744836 IBQ_ATQ=-0.055204445 Loss=1 lnsaleq=. _ERROR_=1 _N_=31048

NOTE: Invalid argument to function LOG(-37.16) at line 21 column 9.

gvkey=015082 datadate=30JUN2019 fyearq=2019 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=SVCTF cusip=81731L109 curcdq=CAD datacqtr=2019Q2 datafqtr=2019Q2 rdq=12AUG2019 atq=2548.264

ceqq=825.661 cheq=18.074 chq=17.609 cshoq=2.676 ibq=-56.555 lctq=. ltq=1704.613 saleq=-38.16

seqq=825.661 teqq=843.651 txdbq=22.483 capxy=0 exchg=19 costat=A prccq=168.61 sic=6799

MVEQ=451.20036 MTBQ=0.5464716875 BTMQ=1.829920969 lnMVEQ=6.1119114981 lnATQ=7.843167622

Leverageq=0.6689310841 IBQ_ATQ=-0.02219354 Loss=1 lnsaleq=. _ERROR_=1 _N_=31050

NOTE: Invalid argument to function LOG(-350.373) at line 21 column 9.

gvkey=015082 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=SVCTF cusip=81731L109 curcdq=CAD datacqtr=2020Q1 datafqtr=2020Q1 rdq=08MAY2020 atq=1980.88

ceqq=639.374 cheq=17.261 chq=16.796 cshoq=2.634 ibq=-341.993 lctq=. ltq=1325.132 saleq=-351.373

seqq=639.374 teqq=655.748 txdbq=25.959 capxy=0 exchg=19 costat=A prccq=109.99 sic=6799

MVEQ=289.71366 MTBQ=0.4531208025 BTMQ=2.2069169952 lnMVEQ=5.6688930559 lnATQ=7.5912964694

Leverageq=0.6689612697 IBQ_ATQ=-0.172647005 Loss=1 lnsaleq=. _ERROR_=1 _N_=31053

NOTE: Invalid argument to function LOG(-222.641) at line 21 column 9.

gvkey=015101 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=MFA cusip=55272X102 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=16JUN2020 atq=11130.337

ceqq=2440.485 cheq=333.367 chq=116.465 cshoq=453.138 ibq=-908.995 lctq=. ltq=8689.662

saleq=-223.641 seqq=2440.675 teqq=2440.675 txdbq=0 capxy=0 exchg=11 costat=A prccq=1.55 sic=6798

MVEQ=702.3639 MTBQ=0.2877968519 BTMQ=3.4746731716 lnMVEQ=6.5544516458 lnATQ=9.3174297223

Leverageq=0.780718679 IBQ_ATQ=-0.081668237 Loss=1 lnsaleq=. _ERROR_=1 _N_=31193

NOTE: Invalid argument to function LOG(-33.625) at line 21 column 9.

gvkey=015452 datadate=30JUN2016 fyearq=2016 fqtr=2 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=LNCOQ cusip=535782106 curcdq=USD datacqtr=2016Q2 datafqtr=2016Q2 rdq=05AUG2016 atq=17.55

ceqq=4.35 cheq=0.847 chq=0.847 cshoq=244.247 ibq=-35.485 lctq=13.2 ltq=13.2 saleq=-34.625

seqq=4.35 teqq=4.35 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.072 sic=1311 MVEQ=17.585784

MTBQ=4.0427089655 BTMQ=0.2473588894 lnMVEQ=2.8670908484 lnATQ=2.8650539499 Leverageq=0.7521367521

IBQ_ATQ=-2.021937322 Loss=1 lnsaleq=. _ERROR_=1 _N_=32451

NOTE: Invalid argument to function LOG(-9.899) at line 21 column 9.

gvkey=015452 datadate=30SEP2016 fyearq=2016 fqtr=3 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=LNCOQ cusip=535782106 curcdq=USD datacqtr=2016Q3 datafqtr=2016Q3 rdq=07NOV2016 atq=6.323

ceqq=-5.13 cheq=0.847 chq=0.847 cshoq=251.645 ibq=-10.927 lctq=11.453 ltq=11.453 saleq=-10.899

seqq=-5.13 teqq=-5.13 txdbq=0 capxy=0 exchg=19 costat=A prccq=0.045 sic=1311 MVEQ=11.324025

MTBQ=-2.207412281 BTMQ=-0.453019134 lnMVEQ=2.4269265749 lnATQ=1.8441937791 Leverageq=1.8113237387

IBQ_ATQ=-1.728135379 Loss=1 lnsaleq=. _ERROR_=1 _N_=32452

NOTE: Invalid argument to function LOG(-4.947) at line 21 column 9.

gvkey=016187 datadate=31MAR2017 fyearq=2017 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=6120B cusip=282645936 curcdq=USD datacqtr=2017Q1 datafqtr=2017Q1 rdq=04MAY2017 atq=3852.675

ceqq=806.124 cheq=1475.115 chq=115.677 cshoq=0.264 ibq=-17.725 lctq=. ltq=3046.551 saleq=-5.947

seqq=806.124 teqq=806.124 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=.

lnMVEQ=. lnATQ=8.2565229912 Leverageq=0.7907625221 IBQ_ATQ=-0.0046007 Loss=1 lnsaleq=. _ERROR_=1

_N_=34057

NOTE: Invalid argument to function LOG(-2.939) at line 21 column 9.

gvkey=016187 datadate=31MAR2020 fyearq=2020 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=6120B cusip=282645936 curcdq=USD datacqtr=2020Q1 datafqtr=2020Q1 rdq=06MAY2020 atq=1484.296

ceqq=667.972 cheq=909.717 chq=131.826 cshoq=0.264 ibq=-7.591 lctq=. ltq=816.324 saleq=-3.939

seqq=667.972 teqq=667.972 txdbq=0 capxy=0 exchg=1 costat=A prccq=. sic=6159 MVEQ=. MTBQ=. BTMQ=.

lnMVEQ=. lnATQ=7.3026958648 Leverageq=0.5499738597 IBQ_ATQ=-0.005114209 Loss=1 lnsaleq=. _ERROR_=1

_N_=34069

NOTE: Invalid argument to function LOG(-1956) at line 21 column 9.

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

gvkey=016384 datadate=31MAR2021 fyearq=2021 fqtr=1 indfmt=INDL consol=C popsrc=D datafmt=STD

tic=VOYA cusip=929089100 curcdq=USD datacqtr=2021Q1 datafqtr=2021Q1 rdq=10MAY2021 atq=162861

ceqq=7931 cheq=3182 chq=1316 cshoq=121.222 ibq=1086 lctq=. ltq=153862 saleq=-1957 seqq=7931

teqq=8999 txdbq=0 capxy=0 exchg=11 costat=A prccq=63.64 sic=6311 MVEQ=7714.56808 MTBQ=0.9727106393

BTMQ=1.0280549627 lnMVEQ=8.9508657788 lnATQ=12.000652355 Leverageq=0.9447442911

IBQ_ATQ=0.0066682631 Loss=0 lnsaleq=. _ERROR_=1 _N_=34258

NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      12941 at 10:12   13505 at 11:10   13505 at 12:10   12941 at 13:8    155 at 17:14

      624 at 18:12     1478 at 21:9     1478 at 21:14    

NOTE: Mathematical operations could not be performed at the following places. The results of the 

      operations have been set to missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      33 at 11:10   1 at 12:10    1 at 13:8     243 at 21:9   

NOTE: There were 251509 observations read from the data set DATA.COMPUSTAT_QUARTER.

NOTE: The data set WORK.QCOMPUSTAT has 167464 observations and 40 variables.

NOTE: DATA statement used (Total process time):

      real time           0.30 seconds

      cpu time            0.12 seconds

      



23   

24   proc sort nodupkey data=qcompustat; by gvkey datadate; run;



NOTE: There were 167464 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 93 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 40 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.08 seconds

      cpu time            0.09 seconds

      



25   

26   data qcompustat;

27   set qcompustat;

28   cusip6=substr(cusip,1,6);

29   lagCAPXY=lag(CAPXY);

30   if lag(gvkey) ne gvkey or 93<datadate-lag(datadate) or datadate-lag(datadate)<0 or

30 ! fqtr-lag(fqtr) ne 1 then lagCAPXY=.;

31   if fqtr=1 then CAPXQ=CAPXY;

32   if fqtr=2 or fqtr=3 or fqtr=4 then CAPXQ=CAPXY-lagCAPXY;

33   CAPXQ_AT=CAPXQ/ATQ;

34   run;



NOTE: Missing values were generated as a result of performing an operation on missing values.

      Each place is given by: (Number of times) at (Line):(Column).

      1 at 30:38       1 at 30:64       86 at 30:88      13800 at 32:47   15705 at 33:15

NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.03 seconds

      



35   

36   proc sort data = qcompustat; by cusip6 datadate descending atq; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167371 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.06 seconds

      cpu time            0.06 seconds

      



37   

38   proc sort data = qcompustat nodupkey; by cusip6 datadate; run;



NOTE: There were 167371 observations read from the data set WORK.QCOMPUSTAT.

NOTE: 266 observations with duplicate key values were deleted.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 44 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.04 seconds

      cpu time            0.07 seconds

      



39   

40   

41   /***********2.Import our sample*************/

42   proc import out = sample

43   datafile = "H:\project\ESG News and Customer\Data\ticnewsdate1013.dta"

44   dbms = '' replace;

45   run;



NOTE: One or more variables were converted because the data type is not supported by the V9 

      engine. For more details, run with options MSGLEVEL=I.

NOTE: The import data set has 2735 observations and 13 variables.

NOTE: WORK.SAMPLE data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

      real time           0.04 seconds

      cpu time            0.00 seconds

      



46   

47   data sample;

48   set sample;

49   sample = 1;

50   run;



NOTE: There were 2735 observations read from the data set WORK.SAMPLE.

NOTE: The data set WORK.SAMPLE has 2735 observations and 14 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



51   

52   proc sort data = sample nodupkey;

53   by gvkey datadate;

54   run;



NOTE: There were 2735 observations read from the data set WORK.SAMPLE.

NOTE: 1275 observations with duplicate key values were deleted.

NOTE: The data set WORK.SAMPLE has 1460 observations and 14 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



55   

56   proc sort data=sample nodupkey out=sample2;

57   by gvkey;

58   run;



NOTE: There were 1460 observations read from the data set WORK.SAMPLE.

NOTE: 1209 observations with duplicate key values were deleted.

NOTE: The data set WORK.SAMPLE2 has 251 observations and 14 variables.

NOTE: PROCEDURE SORT used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



59   

60   data sample2;

61   set sample2;

62   sample2 = 1;

63   keep gvkey sample2;

64   run;



NOTE: There were 251 observations read from the data set WORK.SAMPLE2.

NOTE: The data set WORK.SAMPLE2 has 251 observations and 2 variables.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

      



65   

66   data qcompustat;

67   set qcompustat;

68   gvkey1 = gvkey*1;

69   run;



NOTE: Character values have been converted to numeric values at the places given by: 

      (Line):(Column).

      68:10   

NOTE: There were 167105 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 45 variables.

NOTE: DATA statement used (Total process time):

      real time           0.03 seconds

      cpu time            0.04 seconds

      



70   

71   proc sql;

72   create table qcompustat as select *

73   from qcompustat as a left join sample as b

74   on a.gvkey1 = b.gvkey

75   and a.datadate=b.datadate;

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 

         this is a possible data integrity problem.

WARNING: Variable cusip6 already exists on file WORK.QCOMPUSTAT.

WARNING: Variable gvkey already exists on file WORK.QCOMPUSTAT.

WARNING: Variable datadate already exists on file WORK.QCOMPUSTAT.

WARNING: Variable tic already exists on file WORK.QCOMPUSTAT.

NOTE: Table WORK.QCOMPUSTAT created, with 167105 rows and 55 columns.



76   

77   create table qcompustat as select *

78   from qcompustat as a left join sample2 as b

79   on a.gvkey1 = b.gvkey

80   order by gvkey, datadate;

WARNING: Column named gvkey is duplicated in a select expression (or a view). Explicit references 

         to it will be to the first one.

WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 

         this is a possible data integrity problem.

WARNING: Variable gvkey already exists on file WORK.QCOMPUSTAT.

NOTE: Table WORK.QCOMPUSTAT created, with 167105 rows and 56 columns.



81   quit;

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.25 seconds

      cpu time            0.32 seconds

      



82   

83   data qcompustat;

84   set qcompustat;

85   if sample =. then sample = 0;

86   if sample2 = . then sample2 = 0;

87   run;



NOTE: There were 167105 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 167105 observations and 56 variables.

NOTE: DATA statement used (Total process time):

      real time           0.04 seconds

      cpu time            0.04 seconds

      



88   

89   proc freq data=qcompustat;

90   tables sample sample2;

91   run;



NOTE: Writing HTML Body file: sashtml.htm

NOTE: There were 167105 observations read from the data set WORK.QCOMPUSTAT.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           0.28 seconds

      cpu time            0.20 seconds

      



92   

93   proc freq data=qcompustat;

94   tables datadate;

95   run;



NOTE: There were 167105 observations read from the data set WORK.QCOMPUSTAT.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



96   

97   

98   proc freq data=sample;

99   tables datadate;

100  run;



NOTE: There were 1460 observations read from the data set WORK.SAMPLE.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           0.01 seconds

      cpu time            0.01 seconds

      



101  

102  /*make sure same sample period including fiscal year end date*/

103  data qcompustat;

104  set qcompustat;

105  if year(datadate)<2017 then delete;

106  if year(datadate)=2017 and month(datadate)<10 then delete;

107  if year(datadate)>2020 then delete;

108  run;



NOTE: There were 167105 observations read from the data set WORK.QCOMPUSTAT.

NOTE: The data set WORK.QCOMPUSTAT has 97280 observations and 56 variables.

NOTE: DATA statement used (Total process time):

      real time           0.05 seconds

      cpu time            0.03 seconds

      



109  

110  

111  proc export data=qcompustat

112  outfile = "H:\Project\ESG News and Customer\Submission\Stata Code and

112! Output\comp_compare.dta"

113  dbms = '' replace;

114  run;



NOTE: The export data set has 97280 observations and 56 variables.

NOTE: "H:\Project\ESG News and Customer\Submission\Stata Code and Output\comp_compare.dta" file 

      was successfully created.

NOTE: PROCEDURE EXPORT used (Total process time):

      real time           0.12 seconds

      cpu time            0.06 seconds

      



NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414

NOTE: The SAS System used:

      real time           2:00:42.83

      cpu time            23.12 seconds

      


